Skip to content

Commit

Permalink
temporary workaround for Tor command in socks.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Jun 25, 2018
1 parent 9977ead commit 4f33540
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions proxy/socks/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 4f33540

Please sign in to comment.