Macro
- LOG_DEBUG_DETAIL more detail log
- DISABLE_DEBUG_LOG disable all debug log
- UDP_DEBUG_DETAIL enable tcp log
- TCP_DEBUG_DETAIL enable udp log
- MULTITHREAD_IO enable multithread support
- BUILD_DLL export dll, by default only static lib is compiled
bUild
-
by adding option
-DENABLE_UOUT=ON
, udp over utcp feature will be enabled and it requires some extra librarieson Linux or OSX,
libtins
,libpcap
are required
on Windows,wpcap
,WinDivert
,tins
are requiredcheck the following list for support info
-
when building lib for mobile platform, you need to add
-DBUILD_MOBILE_LIB=ON
generate xcode project for generic device:
mkdir build && cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake -DPLATFORM=OS64 -DBUILD_MOBILE_LIB=ON
for more detail, visit https://github.com/leetal/ios-cmake
UOUT is not support on mobile platform
Encryption:
the encryption method AES-256-GCM
provided by libsodium
UDP over uTCP
proxy udp over unordered tcp connection
what it basically does is wrapping your udp packet with tcp header and send it via tcp connection which doesn't have retransmission and initiative congestion control
support list:
Platform | Server | Client |
---|---|---|
OSX | ✘ | ✔ |
Linux | ✔ | ✔ |
Win64 | ✘ | ✔ |
Win32 | ✘ | ✔ |
The following libraries are required
- spdlog 1.3.1
- libsodium 1.0.17
- libboost_coroutine 1.70.0
- libboost_context
- libboost_regex
- libboost_system
if UDP_OVER_UTCP is defined, on Linux || OSX you also need
- libtins v4.2
- libpcap 1.9.0
- libboost_filesystem 1.70.0
on Win64 you need
- libtins v4.2
- WpdPack 4.1.2
- WinDivert-1.4.3-A
-
udp_over_utcp
enable UDP over uTCP feature, the udp packet will be proxy via unordered tcp connection. -
local_uout_ifname
On Linux or Mac you have to specified the name of default network interface for sending packet. -
local_uout_ip
if it is set to "" or left blank, it would try to fetch the ip of default network interface on startup, if it retrives the wrong ip, the uout connection would be unable to establish, you might set an ip to override. -
server_uout_port
the Port for uout connection. -
dnsuout
whether to proxy dns packet via utcp, it just simply check if the dst port is 53, we are not doing any packet inspection
-
resolve_dns
if set true, it will resolve dns locally instead of sending domain proxy request, udp proxy doesn't support domain resolve -
logtofile
set true to write log to file at the current directory
Test Platform:
i3 8100
DDR4 2400 16G
Ubuntu 18.04 64bit
Server and Client are running on the same machine, we use iperf + proxychains4 for testing
server: iperf -s -i 1
client: proxychains4 iperf -c 127.0.0.1 -P x -t 10
where x is the connection number
Result:
Direct connect 70.5 Gbits/sec
Proxy via libsocks2c
1 Conn: 1.290 Gbits/sec
2 Conn: 2.400 Gbits/sec
3 Conn: 2.340 Gbits/sec
4 Conn: 2.390 Gbits/sec
i3 8100 has only 4 cores and no HT support, we can get almost double performance when increase conn number from 1 to 2, but the curve start to drop slightly when we add more conn into testing.
the tcp session buffer limits the bandwidth,increase buff size to 20480 bytes yields 8.6 Gbits/sec(about 1024MB/s) with dual core which is about 3.6 times than the default.The encryption and obfuscation also have significant impact on performance.