PortForwarder

class wpinet.PortForwarder

Bases: pybind11_object

Forward ports to another host. This is primarily useful for accessing Ethernet-connected devices from a computer tethered to the RoboRIO USB port.

add(port: int, remoteHost: str, remotePort: int) None

Forward a local TCP port to a remote host and port. Note that local ports less than 1024 won’t work as a normal user.

Parameters:
  • port – local port number

  • remoteHost – remote IP address / DNS name

  • remotePort – remote port number

static getInstance() wpinet._wpinet.PortForwarder

Get an instance of the PortForwarder class.

This is a singleton to guarantee that there is only a single instance regardless of how many times GetInstance is called.

remove(port: int) None

Stop TCP forwarding on a port.

Parameters:

port – local port number