From 7692446fd8704c065e38d7868288fc6554cc099c Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Mon, 10 Sep 2018 13:40:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=98=E5=8C=96TCPS=E5=86=85=E5=AD=98?= =?UTF-8?q?=E9=87=8A=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/transport/encrypt/conn.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/lib/transport/encrypt/conn.go b/core/lib/transport/encrypt/conn.go index db35bd8..9080da2 100644 --- a/core/lib/transport/encrypt/conn.go +++ b/core/lib/transport/encrypt/conn.go @@ -38,3 +38,10 @@ func (s *Conn) Read(b []byte) (n int, err error) { func (s *Conn) Write(b []byte) (n int, err error) { return s.w.Write(b) } +func (s *Conn) Close() (err error) { + err = s.Conn.Close() + s.Cipher = nil + s.r = nil + s.w = nil + return err +} From 09348211b67db377540eec30edc2358af9d4cc5e Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Mon, 10 Sep 2018 13:56:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96TCPS=E5=86=85=E5=AD=98?= =?UTF-8?q?=E9=87=8A=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/transport/compress.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/lib/transport/compress.go b/core/lib/transport/compress.go index c26767e..9cd18d3 100644 --- a/core/lib/transport/compress.go +++ b/core/lib/transport/compress.go @@ -39,8 +39,11 @@ func (c *CompStream) Write(p []byte) (n int, err error) { return n, err } -func (c *CompStream) Close() error { - return c.conn.Close() +func (c *CompStream) Close() (err error) { + err = c.conn.Close() + c.r = nil + c.w = nil + return } func (c *CompStream) LocalAddr() net.Addr { return c.conn.LocalAddr() From 96717f0c334abc3e351c1ae892c55383a09239f4 Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Mon, 10 Sep 2018 14:42:04 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=87=8F=E5=B0=91buf=E5=A4=A7=E5=B0=8F,?= =?UTF-8?q?=E9=99=8D=E4=BD=8E=E9=AB=98=E5=B9=B6=E5=8F=91=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E5=86=85=E5=AD=98=E5=8D=A0=E7=94=A8=E9=87=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/leakybuf.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/leakybuf.go b/utils/leakybuf.go index 513c90e..95fbf26 100644 --- a/utils/leakybuf.go +++ b/utils/leakybuf.go @@ -6,7 +6,7 @@ type LeakyBuf struct { freeList chan []byte } -const LeakyBufSize = 2048 // data.len(2) + hmacsha1(10) + data(4096) +const LeakyBufSize = 1024 // data.len(2) + hmacsha1(10) + data(4096) const maxNBuf = 2048 var LeakyBuffer = NewLeakyBuf(maxNBuf, LeakyBufSize) From 4145a31e5b605b7942afdc36897831eb563217d4 Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Tue, 11 Sep 2018 18:37:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=BB=91=E7=99=BD=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E9=A1=B6=E7=BA=A7=E5=9F=9F?= =?UTF-8?q?=E4=BA=86,=E6=AF=94=E5=A6=82:com,=E5=8C=B9=E9=85=8D=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=9A=84.com=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 3 +++ README_ZH.md | 2 +- VERSION | 2 +- install_auto.sh | 2 +- utils/structs.go | 6 ++++++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 78104f4..df86b9e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ proxy更新日志 +v6.1 +1.黑白名单支持设置顶级域了,比如:com,匹配所有的.com域名 + v6.0 企业版开源啦 本次更新主要是把企业版开源,把企业版代码合并到现在的开源goproxy当中,继续遵循GPLv3,免费开源, 之所以直接跳过5.x,用6.0版本号是为了与现有开源版本做一个明显的区分,下面功能主要来自企业版. diff --git a/README_ZH.md b/README_ZH.md index c370d1f..867aae3 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -181,7 +181,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/v6.0/proxy-linux-amd64.tar.gz +wget https://github.com/snail007/goproxy/releases/download/v6.1/proxy-linux-amd64.tar.gz ``` #### **2.下载自动安装脚本** ```shell diff --git a/VERSION b/VERSION index 5049538..e8f1734 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0 \ No newline at end of file +6.1 \ No newline at end of file diff --git a/install_auto.sh b/install_auto.sh index 32bf059..5202b6b 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/v6.0/proxy-linux-amd64.tar.gz +wget https://github.com/snail007/goproxy/releases/download/v6.1/proxy-linux-amd64.tar.gz # #install proxy tar zxvf proxy-linux-amd64.tar.gz diff --git a/utils/structs.go b/utils/structs.go index 7d187f6..570a29d 100644 --- a/utils/structs.go +++ b/utils/structs.go @@ -179,6 +179,12 @@ func (c *Checker) domainIsInMap(address string, blockedMap bool) bool { subSlice := domainSlice[:len(domainSlice)-1] topDomain := strings.Join(domainSlice[len(domainSlice)-1:], ".") checkDomain := topDomain + if !blockedMap && c.directMap.Has(checkDomain) { + return true + } + if blockedMap && c.blockedMap.Has(checkDomain) { + return true + } for i := len(subSlice) - 1; i >= 0; i-- { checkDomain = subSlice[i] + "." + checkDomain if !blockedMap && c.directMap.Has(checkDomain) {