1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 17:05:23 +00:00

temporary workaround for Tor command in socks.

This commit is contained in:
Darien Raymond 2018-06-25 13:20:02 +02:00
parent 9977eadf8c
commit 4f33540b19
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -14,9 +14,11 @@ const (
socks5Version = 0x05
socks4Version = 0x04
cmdTCPConnect = 0x01
cmdTCPBind = 0x02
cmdUDPPort = 0x03
cmdTCPConnect = 0x01
cmdTCPBind = 0x02
cmdUDPPort = 0x03
cmdTorResolve = 0xF0
cmdTorResolvePTR = 0xF1
socks4RequestGranted = 90
socks4RequestRejected = 91
@ -131,7 +133,8 @@ func (s *ServerSession) Handshake(reader io.Reader, writer io.Writer) (*protocol
cmd := buffer.Byte(1)
switch cmd {
case cmdTCPConnect:
case cmdTCPConnect, cmdTorResolve, cmdTorResolvePTR:
// We don't have a solution for Tor case now. Simply treat it as connect command.
request.Command = protocol.RequestCommandTCP
case cmdUDPPort:
if !s.config.UdpEnabled {