"). The following figure illustrates the problem. If the port is not forwarded properly, can to connect the client with the server. The lower arrow, however, shows the connection with configured port forwarding.
![](http://4.bp.blogspot.com/_-C3w1uboIpk/S9SDSLNJ_QI/AAAAAAAABBg/y2OgliAc2NY/s320/Bildschirmfoto1.png)
It can be with simple command-line tools to build any connection backward. The most suitable is socat
: Socat is an excellent program that can combine different data streams together. This is exactly what you can do is quite simple: churningSocat The client on the actual server side connects with both the actual server and with a Socat server on the client side. The client then connects to the server Socat. Since both instances Socat forward the data streams each (Input → Output and vice versa), client and server can now communicate as usual with one another: But looks like from a practical implementation? First of all you have to leave on the client side, the port forward the router. In the following example, worked with Port
![](http://4.bp.blogspot.com/_-C3w1uboIpk/S9HRvP64owI/AAAAAAAABBI/oLycFrL2dxo/s400/NAT.png)
: 55555 TCP-LISTEN: 8080
Socat The server now listens on ports 55 555
and![](http://1.bp.blogspot.com/_-C3w1uboIpk/S9HRvXJEtwI/AAAAAAAABBQ/FUQSsupZIwI/s400/NAT2.png)
On the server side of the Socat client starts:
socat TCP: hostname: 55555 TCP: localhost: 8080![](http://4.bp.blogspot.com/_-C3w1uboIpk/S9HRvi0GQtI/AAAAAAAABBY/PsI5y9fTIeU/s400/NAT3.png)
hostname must be modified accordingly be and must be known, of course, but the IP is simply a page, www.wieistmeineip.de
find out.), and this is connected to the local server (in this case the server listens on port therefore8080, therefore the alternative HTTP port).
Last you need to connect only the client with the Socat server. This requires data only on the compound localhost and the corresponding port change (in the example
8080).course is easy to see that the effort is not to be underestimated. But it may do in some situations paid off handsomely. And not as technically savvy users must be on the other hand, no longer a port forwarding and take care of its IP address. The command can also be easily transferred via Instant Messenger, so that the command will be copied only in a terminal needs. Of course, the approach is not for other application very useful.
0 comments:
Post a Comment