Please follow the steps bellow :
- install Visual Studio Code + Install extension C/C++ IntelliSense. If you haven't install GCC, please follow this link to install GCC at Linux : https://code.visualstudio.com/docs/cpp/config-linux
- install : sudo apt-get install libboost-all-dev
- install : sudo apt install redis
- Open Visual Studio Code and then File > Open Folder > Select "tcp_proxy" that you have clone.
- Still on VScode, Open "main.cpp" then click tab Terminal > Run Build Task.
$ ./main <local host ip> <local port> <forward host ip> <forward port>
eg : ./main 0.0.0.0 1234 185.201.8.86 8080
After the TCP Proxy started, you can try to open http://127.0.0.1:1234 using incognito mode, to avoid opening page in https automatically. When either of the end points terminate their respective connection to the proxy, the proxy will proceed to close (or shutdown) the other corresponding connection.
Any Incoming and Outgoing on each IP is logged into file incoming.csv and outgoing.csv. Just in case if the data log will be used for further analysis. The data log format is shown below:Date Time;Client IP Address:Client Port;Data Length in Bytes;"Raw Data"\n
Each incoming data from Client is also counted using Redis, Therefore you must install Redis to your system. The keyvalue is Client IP Address. Note: Redis will be flush on each time the program started.
-
To get available Client IPs, please follow command bellow using your terminal:
$ redis-cli keys "*" -
To retrive how many bytes received from specific Client IP address, please follow command bellow using your terminal:
$ redis-cli GET <IP Address> eg : $ redis-cli GET 127.0.0.1