Signed-off-by: arraykeys@gmail.com <arraykeys@gmail.com>

This commit is contained in:
arraykeys@gmail.com
2018-06-29 17:55:19 +08:00
parent 361215fb6f
commit 2336e77ac4
2 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,8 @@
proxy更新日志 proxy更新日志
v5.2
1.修复了反向代理无法正常工作的问题.
2.修复了自定义加密导致HTTP(S)\SPS反向代理无法正常工作的问题.
v5.1 v5.1
1.优化了kcp默认mtu配置,调整为450. 1.优化了kcp默认mtu配置,调整为450.
2.优化了HTTP(S)\SOCKS5代理智能判断更加精确。 2.优化了HTTP(S)\SOCKS5代理智能判断更加精确。

View File

@ -17,6 +17,7 @@ import (
"github.com/snail007/goproxy/services/kcpcfg" "github.com/snail007/goproxy/services/kcpcfg"
"github.com/snail007/goproxy/utils" "github.com/snail007/goproxy/utils"
"github.com/snail007/goproxy/utils/conncrypt" "github.com/snail007/goproxy/utils/conncrypt"
"github.com/snail007/goproxy/utils/sni"
"github.com/snail007/goproxy/utils/socks" "github.com/snail007/goproxy/utils/socks"
) )
@ -218,7 +219,7 @@ func (s *SPS) OutToTCP(inConn *net.Conn) (err error) {
bInConn.ReadByte() bInConn.ReadByte()
bInConn.UnreadByte() bInConn.UnreadByte()
n := 8 n := 2048
if n > bInConn.Buffered() { if n > bInConn.Buffered() {
n = bInConn.Buffered() n = bInConn.Buffered()
} }
@ -228,12 +229,12 @@ func (s *SPS) OutToTCP(inConn *net.Conn) (err error) {
(*inConn).Close() (*inConn).Close()
return return
} }
isSNI, _ := sni.ServerNameFromBytes(h)
*inConn = bInConn *inConn = bInConn
address := "" address := ""
var auth socks.Auth var auth socks.Auth
var forwardBytes []byte var forwardBytes []byte
//fmt.Printf("%v", header) //fmt.Printf("%v", h)
if utils.IsSocks5(h) { if utils.IsSocks5(h) {
if *s.cfg.DisableSocks5 { if *s.cfg.DisableSocks5 {
(*inConn).Close() (*inConn).Close()
@ -251,7 +252,7 @@ func (s *SPS) OutToTCP(inConn *net.Conn) (err error) {
} }
address = serverConn.Target() address = serverConn.Target()
auth = serverConn.AuthData() auth = serverConn.AuthData()
} else if utils.IsHTTP(h) { } else if utils.IsHTTP(h) || isSNI != "" {
if *s.cfg.DisableHTTP { if *s.cfg.DisableHTTP {
(*inConn).Close() (*inConn).Close()
return return