MyNixOS website logo
Description

Retrieve Network Statistics Including Available TCP Ports.

R interface for the 'netstat' command line utility used to retrieve and parse commonly used network statistics, including available and in-use transmission control protocol (TCP) ports. Primers offering technical background information on the 'netstat' command line utility are available in the "Linux System Administrator's Manual" by Michael Kerrisk (2014) <https://man7.org/linux/man-pages/man8/netstat.8.html>, and on the Microsoft website (2017) <https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat>.

netstat

CRANstatus Travis buildstatus

netstat allows you to easily view which TCP ports are in use and which are free to use.

# install.packages("netstat")
library(netstat)

See which TCP ports are currently in use with ports_in_use()

ports_in_use()
##  [1]   137   138  1024  5353  5432  9947 11090 12113 12441 13445 13675 18588
## [13] 21946 29434 30402 39333 49153 49154 49155 49156 49157 50038 50869 51223
## [25] 51225 51226 51233 51238 51281 51282 51285 51286 51287 51497 51882 52366
## [37] 52874 52953 52977 53026 53072 53253 53470 54258 54709 55143 55342 55878
## [49] 56063 56109 56340 56365 56566 56607 56699 56729 56730 56743 56752 56753
## [61] 56755 56758 56766 56852 56853 56854 56859 56860 56864 56870 56876 56877
## [73] 56878 56898 56907 56924 57182 57863 57958 57987 58939 59344 59457 60289
## [85] 60873 61825 61932 62589 63035 63561 64543 64720

Find a free TCP port using free_port()

free_port()
## [1] 14415
  • 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.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows