[Lazarus] FreePascal TCPIP data tunnel code sample?
Koenraad Lelong
lazarus2 at de-brouwerij.be
Thu Feb 4 21:10:54 CET 2016
Op 04-02-16 om 17:17 schreef Bo Berglund:
> I wonder if someone has built a program that can be used as a "tunnel"
> of data from one TCP server to a TCP client on another network?
> The program should sit in between in a computer connected to both
> networks (Ethernet and WiFi).
> If so I would be grateful to share the solutions.
>
> Reason:
> I am trying to develop a client program for controlling a data
> collection instrument, which has WiFi connectivity only.
> Its connection is implemented as a WiFi Access Point to which you
> connect. Then you have access to the data source via TCP port 1001.
> The source is actually operating via RS232 internally.
> There is a protocol involved for commanding actions and for
> transferring data in both directions.
>
> Now, I would like to be able to connect to this unit from my place of
> coding by having a multi-homed device sitting close to the instrument
> and connecting to it via the WiFi AP, but at the same time it is also
> connected to the office network by Ethernet.
> The device should run a program to connect it to the data port
> (TCP:1001) of the WiFi AP and start a TCP server on the Ethernet
> connection on TCP port 1001.
> Then whatever data comes in through the Ethernet port should be sent
> via the WiFi connection to the instrument.
> All data received from the instrument should be sent out to the
> connected client on the Ethernet connection.
> So the program I am looking for should not do anything at all with the
> data content, except transfer byte-by-byte between the networks.
>
> And this should be running on a Raspberry Pi2B so it can be easily
> deployed in the place the instrument is located. Meanwhile I can sit
> in another building and test the actual client code.
>
> Is there something like this available already?
>
>
Hi,
Isn't this just port-forwarding ? Set up the firewall to forward data to
the wired NIC to the device's address and port.
If you want it secure, you could use stunnel.
My 2 cents,
Koenraad.
More information about the Lazarus
mailing list