[Lazarus] FreePascal TCPIP data tunnel code sample?

Bo Berglund bo.berglund at gmail.com
Thu Feb 4 17:17:45 CET 2016


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?


-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list