The TCP Tunnel API.
The TCP Tunnel API is a high level wrapper for streaming, allowing applications to tunnel traffic through Nabto by integrating through a simple TCP socket, just like e.g. SSH tunnels. TCP Tunnels can hence be used to quickly add remote access capabilities to existing applications that already support TCP communication.
The client opens a TCP listener which listens for incoming TCP connections on the local port. When a connection is accepted by the TCP listener, a new stream is created to the device. When the stream is created on the device, the device opens a TCP connection to the specified service. Once this connection is opened, TCP data flows from the TCP client on the client side to the TCP server on the device side.
TCP Tunnel instances are created using the Connection.createTcpTunnel() factory method. The TcpTunnel object must be kept alive while in use.
public interface TcpTunnel extends AutoCloseable