Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
snail007 committed Jul 5, 2018
1 parent 12dd591 commit 6b4ee97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,14 @@ server连接到bridge的时候,如果同时有多个client连接到同一个brid
`./proxy help client`

### **5.SOCKS5代理**
提示:SOCKS5代理,支持CONNECT,UDP协议,不支持BIND,支持用户名密码认证.
提示:

SOCKS5代理,支持CONNECT,UDP协议,不支持BIND,支持用户名密码认证.

***如果你的VPS是阿里云,腾讯云这种VPS,就是ifconfig看不见你的公网IP,只能看见内网IP,***

***那么需要加上`-g VPS公网IP`参数,SOCKS5代理的UDP功能才能正常工作。***

#### **5.1.普通SOCKS5代理**
`./proxy socks -t tcp -p "0.0.0.0:38080"`

Expand Down
5 changes: 4 additions & 1 deletion services/socks/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ func (s *Socks) proxyUDP(inConn *net.Conn, methodReq socks.MethodsRequest, reque
}
host, _, _ := net.SplitHostPort((*inConn).LocalAddr().String())
_, port, _ := net.SplitHostPort(udpListener.LocalAddr().String())
s.log.Printf("proxy udp on %s , for %s", udpListener.LocalAddr(), inconnRemoteAddr)
if len(*s.cfg.LocalIPS) > 0 {
host = (*s.cfg.LocalIPS)[0]
}
s.log.Printf("proxy udp on %s , for %s", net.JoinHostPort(host, port), inconnRemoteAddr)
request.UDPReply(socks.REP_SUCCESS, net.JoinHostPort(host, port))
s.userConns.Set(inconnRemoteAddr, inConn)
var (
Expand Down

0 comments on commit 6b4ee97

Please sign in to comment.