We need a program to bridge 2 TCP servers. This program can create a TCP connection to "internal" port and another TCP connection to "external" port. Data is transferred from "internal" to "external".
The data from internal is clear text and ended with new line '\n'. The data to external is encrypted with AES. There is a simple login process to external server.
There is an open source project [url removed, login to view] can do similar job but it needs to be modified for a few things:
- create client connection instead of listening on port;
- recover if either internal/external connection is broken. Losing data during recovery is ok.
- external connection needs to be encrypted. There is another open source project [url removed, login to view] can be used.
We have implemented the solution in node.js. You can use it for testing.
The program is expected to be used on embedded device RT5350, so it should be written in ANSI C and compiled with openwrt (see Makefile in proxy project).
Sample code (in node.js) is available;
"internal" and "external" simulator is ready for testing;
Design diagram is also available;