Skip to content

Accepts all incoming TCP connections , and forwards the connections through a SOCKS server

License

Notifications You must be signed in to change notification settings

BrockChen/tun2socks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tun2socks

Accepts all incoming TCP connections , and forwards the connections through a SOCKS server

structure

                                              +---------------+
                                         +--->|  tcp_conn_cb  |---+
                                         |    +---------------+   |
+----------------+ -----> +-----------+  |    +---------------+   |   +-----------------+ -----> +---------------+
|ip packet frames|        |tcp segment+--+--->|  tcp_read_cb  |---+->>| virtual program |        |  socks proxy  |
+----------------+ <----- +-----------+       +---------------+   +---+-----------------+ <----- +---------------+
                                ^             +---------------+   |
                                +-------------|   tcp_write   |<--+
                                              +---------------+

tips

ip layer

this layer has to reassemble the datagram and pass it to the higher protocol layer.

tcp layer

if ip packet frames come from host apps, and because of it not recv or send data by network, so it don't need set timeout and retransmission

About

Accepts all incoming TCP connections , and forwards the connections through a SOCKS server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published