From 17a7281924395e00d34ef0de89adf704848e9ba2 Mon Sep 17 00:00:00 2001 From: Sherlock Holo Date: Wed, 27 Feb 2019 20:47:30 +0800 Subject: [PATCH] Update dependencies and Bump version Signed-off-by: Sherlock Holo --- client/client.go | 4 ++-- cmd/version.go | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- server/server.go | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/client.go b/client/client.go index f2e7d32..093bd54 100644 --- a/client/client.go +++ b/client/client.go @@ -23,7 +23,7 @@ type Client struct { config *client.Config wsURL string wsDialer websocket.Dialer - manager *link.Manager + manager link.Manager managerLock sync.RWMutex } @@ -110,7 +110,7 @@ func (c *Client) reconnect() error { if err != nil { return errors.WithStack(err) } - c.manager = link.NewManager(wsWrapper.NewWrapper(conn), link.KeepaliveConfig()) + c.manager = link.NewManager(wsWrapper.NewWrapper(conn), link.KeepaliveConfig(link.ClientMode)) return nil } diff --git a/cmd/version.go b/cmd/version.go index de1a659..fd7ad3d 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,3 +1,3 @@ package cmd -const version = "0.6.5" +const version = "0.7.0" diff --git a/go.mod b/go.mod index c2d8e71..e82996b 100644 --- a/go.mod +++ b/go.mod @@ -2,9 +2,9 @@ module github.com/Sherlock-Holo/camouflage require ( github.com/BurntSushi/toml v0.3.1 - github.com/Sherlock-Holo/goutils v0.0.0-20180828013039-2447c3761d0f + github.com/Sherlock-Holo/goutils/websocket v0.0.0-20190227124339-861fac9fe37b github.com/Sherlock-Holo/libsocks v0.0.0-20190226021943-514fdf27483e - github.com/Sherlock-Holo/link v0.3.0 + github.com/Sherlock-Holo/link v0.4.0 github.com/gorilla/websocket v1.4.0 github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/pkg/errors v0.8.1 diff --git a/go.sum b/go.sum index 7c5f2d0..b649713 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,11 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Sherlock-Holo/goutils v0.0.0-20180828013039-2447c3761d0f h1:1iThzSags3+tEJly03ufRdIJKXDmsWJGC2G0j75Z+dI= -github.com/Sherlock-Holo/goutils v0.0.0-20180828013039-2447c3761d0f/go.mod h1:XIQ0d16kdYVZLHtOrtDlgcYFDy337n4cmcfYTPIMrK4= +github.com/Sherlock-Holo/goutils/websocket v0.0.0-20190227124339-861fac9fe37b h1:WO/XNu6V1jzqAUnUyyf5inaoNA6fWvb1ueU5b5VXCnk= +github.com/Sherlock-Holo/goutils/websocket v0.0.0-20190227124339-861fac9fe37b/go.mod h1:tHfa/dGMMz9AiAMpdH9U+nATBqt3gimPiEx3xZde/TI= github.com/Sherlock-Holo/libsocks v0.0.0-20190226021943-514fdf27483e h1:DQ4XhFLwVusmV9PGpKlNAtPa2lDyk/JrhE8VR/kptVM= github.com/Sherlock-Holo/libsocks v0.0.0-20190226021943-514fdf27483e/go.mod h1:jaHescOvrHhc0rUymZyZPMUa8LUmJ7uXSR9og50YG0U= -github.com/Sherlock-Holo/link v0.3.0 h1:bVV3W1o1grYvFJcxEQYoaTAuFttyr+rhse/kMK8ZAzQ= -github.com/Sherlock-Holo/link v0.3.0/go.mod h1:TRqtw2S/5okbpl6JJQt4o/a+ypUk8WxapgevtOizuOc= +github.com/Sherlock-Holo/link v0.4.0 h1:xf9bKoqV46cYXnOxR4g35fVq1ztD5j/YgqCIrK4C8NU= +github.com/Sherlock-Holo/link v0.4.0/go.mod h1:9mi9XskP8AAoWgGijvPYwOirhC5raP8JYHpnXusNnzs= github.com/akutz/memconn v0.1.0 h1:NawI0TORU4hcOMsMr11g7vwlCdkYeLKXBcxWu2W/P8A= github.com/akutz/memconn v0.1.0/go.mod h1:Jo8rI7m0NieZyLI5e2CDlRdRqRRB4S7Xp77ukDjH+Fw= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= diff --git a/server/server.go b/server/server.go index da5f49e..2990e45 100644 --- a/server/server.go +++ b/server/server.go @@ -53,7 +53,7 @@ func (s *Server) checkRequest(w http.ResponseWriter, r *http.Request) { return } - manager := link.NewManager(wsWrapper.NewWrapper(conn), link.KeepaliveConfig()) + manager := link.NewManager(wsWrapper.NewWrapper(conn), link.KeepaliveConfig(link.ServerMode)) for { l, err := manager.Accept() if err != nil { @@ -70,7 +70,7 @@ func (s *Server) webHandle(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, s.config.WebRoot) } -func handle(l *link.Link) { +func handle(l link.Link) { address, err := libsocks.DecodeFrom(l) if err != nil { log.Printf("decode socks failed: %+v", errors.WithStack(err))