From 0fbc89ee31737d478a9d76fe245c3716f76c1ab5 Mon Sep 17 00:00:00 2001 From: Tomasen Date: Tue, 8 Dec 2015 21:41:48 +0800 Subject: [PATCH] update README.md --- README.md | 2 +- main.go | 2 +- main_test.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be5097c..0d27390 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,6 @@ Pull request must pass: - [ ] Improve test coverage to over 90% - [x] 支持 net/http/pprof - [x] 支持 HTTP 反向代理 (使用 Header `X-Cipher-Origin`) -- [ ] 支持 binary protocol +- [x] 支持 binary protocol - [ ] 支持更多加密解密算法 - [ ] 支持 consul 服务发现 diff --git a/main.go b/main.go index 54c104f..a3c93b9 100644 --- a/main.go +++ b/main.go @@ -290,7 +290,7 @@ func handleConn(c net.Conn) { // TODO: check if addr is allowed // Build tunnel - backend, err := net.DialTimeout("tcp", string(addr), 5*time.Second) + backend, err := net.DialTimeout("tcp", string(addr), time.Second*time.Duration(_BackendDialTimeout)) if err != nil { // handle error switch err := err.(type) { diff --git a/main_test.go b/main_test.go index 266ce22..c18d145 100644 --- a/main_test.go +++ b/main_test.go @@ -48,6 +48,7 @@ func TestMain(m *testing.M) { // start listen os.Setenv("SECRET", string(_secret)) + os.Setenv("BACKEND_TIMEOUT", "1") go main()