diff --git a/README_ZH.md b/README_ZH.md index fd831d4..e86a901 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -48,7 +48,7 @@ Proxy是golang实现的高性能http,https,websocket,tcp,udp,socks5代理服务 - ... -本页是v5.3手册,其他版本手册请点击[这里](docs/old-release.md)查看. +本页是v5.4手册,其他版本手册请点击[这里](docs/old-release.md)查看. ### 怎么找到组织? @@ -159,7 +159,7 @@ curl -L https://raw.githubusercontent.com/snail007/goproxy/master/install_auto.s 下载地址:https://github.com/snail007/goproxy/releases ```shell cd /root/proxy/ -wget https://github.com/snail007/goproxy/releases/download/v5.3/proxy-linux-amd64.tar.gz +wget https://github.com/snail007/goproxy/releases/download/v5.4/proxy-linux-amd64.tar.gz ``` #### **2.下载自动安装脚本** ```shell diff --git a/docs/old-release.md b/docs/old-release.md index d7c3c40..5ac0994 100644 --- a/docs/old-release.md +++ b/docs/old-release.md @@ -1,5 +1,6 @@ # Old Versions of Proxy +- [v5.3手册](https://github.com/snail007/goproxy/tree/v5.3) - [v5.2手册](https://github.com/snail007/goproxy/tree/v5.2) - [v5.1手册](https://github.com/snail007/goproxy/tree/v5.1) - [v5.0手册](https://github.com/snail007/goproxy/tree/v5.0) diff --git a/install_auto.sh b/install_auto.sh index 515a2a7..295a483 100755 --- a/install_auto.sh +++ b/install_auto.sh @@ -5,7 +5,7 @@ if [ -e /tmp/proxy ]; then fi mkdir /tmp/proxy cd /tmp/proxy -wget https://github.com/snail007/goproxy/releases/download/v5.3/proxy-linux-amd64.tar.gz +wget https://github.com/snail007/goproxy/releases/download/v5.4/proxy-linux-amd64.tar.gz # #install proxy tar zxvf proxy-linux-amd64.tar.gz diff --git a/main.go b/main.go index 900bab4..9d0cd56 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( "github.com/snail007/goproxy/services" ) -const APP_VERSION = "5.3" +const APP_VERSION = "5.4" func main() { err := initConfig() diff --git a/release.sh b/release.sh index 98508d6..afbd889 100755 --- a/release.sh +++ b/release.sh @@ -1,5 +1,5 @@ #!/bin/bash -VER="5.3" +VER="5.4" RELEASE="release-${VER}" rm -rf .cert mkdir .cert diff --git a/utils/functions.go b/utils/functions.go index f25ee2a..0e960fb 100755 --- a/utils/functions.go +++ b/utils/functions.go @@ -22,15 +22,14 @@ import ( "golang.org/x/crypto/pbkdf2" + "context" "strconv" "strings" "time" - "context" "github.com/snail007/goproxy/utils/id" kcp "github.com/xtaci/kcp-go" - ) func IoBind(dst io.ReadWriteCloser, src io.ReadWriteCloser, fn func(err interface{}), log *logger.Logger) { @@ -210,8 +209,13 @@ func CloseConn(conn *net.Conn) { (*conn).Close() } } -func GetAllInterfaceAddr() ([]net.IP, error) { +var allInterfaceAddrCache []net.IP + +func GetAllInterfaceAddr() ([]net.IP, error) { + if allInterfaceAddrCache != nil { + return allInterfaceAddrCache, nil + } ifaces, err := net.Interfaces() if err != nil { return nil, err @@ -252,6 +256,7 @@ func GetAllInterfaceAddr() ([]net.IP, error) { return nil, fmt.Errorf("no address Found, net.InterfaceAddrs: %v", addresses) } //only need first + allInterfaceAddrCache = addresses return addresses, nil } func UDPPacket(srcAddr string, packet []byte) []byte { @@ -635,14 +640,13 @@ func InsertProxyHeaders(head []byte, headers string) []byte { // return // } - /* net.LookupIP may cause deadlock in windows https://github.com/golang/go/issues/24178 */ func MyLookupIP(host string) ([]net.IP, error) { - ctx ,cancel := context.WithTimeout(context.Background(),time.Second *time.Duration(3)) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*time.Duration(3)) defer func() { cancel() //ctx.Done()