SOCKS4,SOCKS5¶
SOCKS4¶
Standard SOCKS4 proxy service, also compatible with SOCKS4A protocol.
BIND Method
SOCKS4(A) currently only supports the CONNECT method.
SOCKS5¶
GOST fully implements all the functions of the SOCKS5 protocol, including three commands (CONNECT, BIND and UDP ASSOCIATE) in RFC1928 and the username/password authentication in RFC1929.
Standard SOCKS5 Proxy Service¶
BIND¶
The BIND function is disabled by default on the server, but can be enabled through bind
option.
UDP ASSOCIATE¶
The UDP relay feature is disabled by default on the server side, and can be enabled through udp
option.
Server
udp
(bool, default=false)- Enable UDP relay function, which is disabled by default.
udpBufferSize
(int, default=4096)- UDP buffer size. The minimum value is: maximum UDP packet size + 10, otherwise data transfer will fail.
Client
relay
(bool, default=false)- Use standard UDP relay method to transmit data, UDP-TUN (UDP-Over-TCP tunnel) method is used by default.
udpBufferSize
(int, default=4096)- UDP buffer size. The minimum value is: maximum UDP packet size + 10, otherwise data transfer will fail.
iperf Test¶
You can use iperf3 to test the UDP relay function.
Start iperf3 service:
Start the standard SOCKS5 service (you can also use other SOCKS5 services that support UDP relay):
Start port forwarding:
gost -L "tcp://:15201/:5201" -L "udp://:15201/:5201?keepalive=true&readBufferSize=65535" -F "socks5://:1080?relay=udp&udpBufferSize=65535"
Execute perf3 UDP test:
Extended functions¶
GOST adds some extended functions based on the standard SOCKS5 protocol.
Negotiated Encryption¶
GOST supports the 0x00 (NO AUTHENTICATION REQUIRED) and 0x02 (USERNAME/PASSWORD) methods of the standard SOCKS5 protocol, and expands two methods on this basis: TLS (0x80) and TLS-AUTH (0x82) for data encryption.
If both the client and the server use GOST, data transmission will be encrypted by default (negotiation method 0x80 or 0x82), otherwise standard SOCKS5 communication is used (0x00 or 0x02 method). The encryption negotiation function can be turned off on either side through notls
option.
MBIND (Multiplex BIND)¶
GOST extends the BIND method and adds a Multiplex-BIND method (0xF2) that supports multiplexing. Multiplexing is based on the xtaci/smux. This extension is mainly used for TCP remote port forwarding.
Server
Client
UDP-TUN (UDP-Over-TCP Tunnel)¶
GOST extends the UDP relay method and adds the UDP-Over-TCP method (0xF3). This extension is mainly used for UDP port forwarding.
Server
Client
Data Channel¶
SOCKS proxy can be used in combination with various data channels.
SOCKS Over TLS¶
Double Encryption
In order to avoid double encryption, the encryption negotiation function of SOCKS5 is turned off (notls=true).