On the Yun, we open a listener on the TCP port 8888 which will forward data to port 6571 of a specified IP (127.0.0.1)
opkg install socat
(socat TCP-LISTEN:8888,fork TCP:127.0.0.1:6571) &
socat - 220.127.116.11-1 - SoCat (for SOcket CAT) establishes two bidirectional byte streams and transfers data between them. Data channels may be files, pipes, devices (terminal or modem, etc.), or sockets (Unix, IPv4, IPv6, raw, UDP, TCP, SSL). It provides forking, logging and tracing, different modes for interprocess communication and many more options.
rinetd - 0.62-2 - Rinetd redirects TCP connections from one IP address and port to another. Rinetd is a single-process server which handles any number of connections to the address/port pairs specified in the configuration. Since rinetd runs as a single process using nonblocking I/O, it is able to redirect a large number of connections without a severe impact on the machine.
xinetd - 2.3.15-1 - xinetd has access control mechanisms, extensive logging capabilities, the ability to make services available based on time, can place limits on the number of servers that can be started, and has deployable defence mechanisms to protect against port scanners, among other things.
netcat - 0.7.1-2 - Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol. It is designed to be a reliable “back-end” tool that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.
Help application which display the port is opened:
opkg install net-tools-netstat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:5700 0.0.0.0:* LISTEN 864/python
tcp 0 0 127.0.0.1:6571 0.0.0.0:* LISTEN 864/python