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

View File

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