-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.Rmd
45 lines (30 loc) · 1.25 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# netstat <a href='https://github.com/stevecondylios/netstat'><img src='man/figures/netstat.png' align="right" height="139" /></a>
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/netstat)](https://cran.r-project.org/package=netstat)
[![Travis build status](https://travis-ci.org/stevecondylios/netstat.svg?branch=master)](https://travis-ci.org/stevecondylios/netstat)
![Downloads](https://cranlogs.r-pkg.org/badges/netstat)
<!-- badges: end -->
`netstat` allows you to easily view which TCP ports are in use and which are free to use.
```{r results = 'hide', warning=FALSE, message=FALSE}
# install.packages("netstat")
library(netstat)
```
### See which TCP ports are currently in use with `ports_in_use()`
```{r}
ports_in_use()
```
### Find a free TCP port using `free_port()`
```{r}
free_port()
```
- `free_port()` returns an available TCP port from Internet Assigned Numbers Authority (IANA) listed
unassigned ports.
- `free_port()` will not return any TCP port currently in use - so
`free_port()` can safely be used to allocate a ports programmatically without collisions - great for
automated testing or browser automation in general