From cf5851740253efdf99216d31168b74d431ed79b9 Mon Sep 17 00:00:00 2001 From: Barak Sharoni Date: Mon, 24 May 2021 01:23:15 +0300 Subject: [PATCH 1/7] tunnel Config now has logInfo attribute --- client/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 32338beb..88c88f09 100644 --- a/client/client.go +++ b/client/client.go @@ -42,6 +42,7 @@ type Config struct { Headers http.Header TLS TLSConfig DialContext func(ctx context.Context, network, addr string) (net.Conn, error) + LogInfo bool } //TLSConfig for a Client @@ -103,7 +104,7 @@ func NewClient(c *Config) (*Client, error) { tlsConfig: nil, } //set default log level - client.Logger.Info = true + client.Logger.Info = c.LogInfo //configure tls if u.Scheme == "wss" { tc := &tls.Config{} From 74cdccc0c348722980dd36f3a7896ef6a7508941 Mon Sep 17 00:00:00 2001 From: Barak Sharoni Date: Mon, 31 May 2021 12:14:43 +0300 Subject: [PATCH 2/7] Renamed --- client/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index 88c88f09..ae9c8733 100644 --- a/client/client.go +++ b/client/client.go @@ -42,7 +42,7 @@ type Config struct { Headers http.Header TLS TLSConfig DialContext func(ctx context.Context, network, addr string) (net.Conn, error) - LogInfo bool + Verbose bool } //TLSConfig for a Client @@ -104,7 +104,7 @@ func NewClient(c *Config) (*Client, error) { tlsConfig: nil, } //set default log level - client.Logger.Info = c.LogInfo + client.Logger.Info = c.Verbose //configure tls if u.Scheme == "wss" { tc := &tls.Config{} From 6397061985e7f757c0f45603413a56f81306991e Mon Sep 17 00:00:00 2001 From: Barak Sharoni Date: Mon, 31 May 2021 12:20:51 +0300 Subject: [PATCH 3/7] renamed chisel module --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a27541fb..5269ea99 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/jpillora/chisel +module github.com/zuzgon/chisel go 1.13 From 700462adfd50bebd5292fa586844fd3ea733ccf7 Mon Sep 17 00:00:00 2001 From: Barak Sharoni Date: Mon, 31 May 2021 12:26:18 +0300 Subject: [PATCH 4/7] renamed chisel module --- go.mod | 5 +---- go.sum | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 5269ea99..6d1f7428 100644 --- a/go.mod +++ b/go.mod @@ -3,17 +3,14 @@ module github.com/zuzgon/chisel go 1.13 require ( - github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 // indirect github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/fsnotify/fsnotify v1.4.9 github.com/gorilla/websocket v1.4.2 - github.com/jpillora/ansi v1.0.2 // indirect github.com/jpillora/backoff v1.0.0 + github.com/jpillora/chisel v1.7.6 github.com/jpillora/requestlog v1.0.0 github.com/jpillora/sizestr v1.0.0 - github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 golang.org/x/net v0.0.0-20200707034311-ab3426394381 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 - golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect ) diff --git a/go.sum b/go.sum index 7342ff1b..1aa63ee2 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,8 @@ github.com/jpillora/ansi v1.0.2 h1:+Ei5HCAH0xsrQRCT2PDr4mq9r4Gm4tg+arNdXRkB22s= github.com/jpillora/ansi v1.0.2/go.mod h1:D2tT+6uzJvN1nBVQILYWkIdq7zG+b5gcFN5WI/VyjMY= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/jpillora/chisel v1.7.6 h1:ipVmcsJcz90+0u0rkn07wKwcXNiw1W/3E2w3rxIPpWM= +github.com/jpillora/chisel v1.7.6/go.mod h1:BC2zg11mTIoyGPUjc2EkTgfz3uUUV93+K9tNYCCU/fw= github.com/jpillora/requestlog v1.0.0 h1:bg++eJ74T7DYL3DlIpiwknrtfdUA9oP/M4fL+PpqnyA= github.com/jpillora/requestlog v1.0.0/go.mod h1:HTWQb7QfDc2jtHnWe2XEIEeJB7gJPnVdpNn52HXPvy8= github.com/jpillora/sizestr v1.0.0 h1:4tr0FLxs1Mtq3TnsLDV+GYUWG7Q26a6s+tV5Zfw2ygw= From 0c69dced626f1e044a8a5e20d89360404ec23cf1 Mon Sep 17 00:00:00 2001 From: Barak Sharoni Date: Mon, 31 May 2021 12:33:37 +0300 Subject: [PATCH 5/7] Changed main as well --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index bba3e747..130c5f02 100644 --- a/main.go +++ b/main.go @@ -12,10 +12,10 @@ import ( "strings" "time" - chclient "github.com/jpillora/chisel/client" - chserver "github.com/jpillora/chisel/server" - chshare "github.com/jpillora/chisel/share" - "github.com/jpillora/chisel/share/cos" + chclient "github.com/zuzgon/chisel/client" + chserver "github.com/zuzgon/chisel/server" + chshare "github.com/zuzgon/chisel/share" + "github.com/zuzgon/chisel/share/cos" ) var help = ` @@ -424,6 +424,7 @@ func client(args []string) { config.Headers.Set("Host", *hostname) } //ready + config.Verbose = *verbose c, err := chclient.NewClient(&config) if err != nil { log.Fatal(err) From 9c2e52a5243db77e58057796ef2f5d9433a17cc5 Mon Sep 17 00:00:00 2001 From: Barak Sharoni Date: Mon, 31 May 2021 12:38:38 +0300 Subject: [PATCH 6/7] revert changes --- go.mod | 7 +++++-- main.go | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 6d1f7428..a27541fb 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,19 @@ -module github.com/zuzgon/chisel +module github.com/jpillora/chisel go 1.13 require ( + github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 // indirect github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 github.com/fsnotify/fsnotify v1.4.9 github.com/gorilla/websocket v1.4.2 + github.com/jpillora/ansi v1.0.2 // indirect github.com/jpillora/backoff v1.0.0 - github.com/jpillora/chisel v1.7.6 github.com/jpillora/requestlog v1.0.0 github.com/jpillora/sizestr v1.0.0 + github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 golang.org/x/net v0.0.0-20200707034311-ab3426394381 golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 + golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect ) diff --git a/main.go b/main.go index 130c5f02..bba3e747 100644 --- a/main.go +++ b/main.go @@ -12,10 +12,10 @@ import ( "strings" "time" - chclient "github.com/zuzgon/chisel/client" - chserver "github.com/zuzgon/chisel/server" - chshare "github.com/zuzgon/chisel/share" - "github.com/zuzgon/chisel/share/cos" + chclient "github.com/jpillora/chisel/client" + chserver "github.com/jpillora/chisel/server" + chshare "github.com/jpillora/chisel/share" + "github.com/jpillora/chisel/share/cos" ) var help = ` @@ -424,7 +424,6 @@ func client(args []string) { config.Headers.Set("Host", *hostname) } //ready - config.Verbose = *verbose c, err := chclient.NewClient(&config) if err != nil { log.Fatal(err) From 35a81ff6a9f555a5e9b63d8bfc1ca3cd2b5d3681 Mon Sep 17 00:00:00 2001 From: Barak Sharoni Date: Mon, 31 May 2021 12:39:16 +0300 Subject: [PATCH 7/7] cleaned mod.sum --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 1aa63ee2..7342ff1b 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,6 @@ github.com/jpillora/ansi v1.0.2 h1:+Ei5HCAH0xsrQRCT2PDr4mq9r4Gm4tg+arNdXRkB22s= github.com/jpillora/ansi v1.0.2/go.mod h1:D2tT+6uzJvN1nBVQILYWkIdq7zG+b5gcFN5WI/VyjMY= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jpillora/chisel v1.7.6 h1:ipVmcsJcz90+0u0rkn07wKwcXNiw1W/3E2w3rxIPpWM= -github.com/jpillora/chisel v1.7.6/go.mod h1:BC2zg11mTIoyGPUjc2EkTgfz3uUUV93+K9tNYCCU/fw= github.com/jpillora/requestlog v1.0.0 h1:bg++eJ74T7DYL3DlIpiwknrtfdUA9oP/M4fL+PpqnyA= github.com/jpillora/requestlog v1.0.0/go.mod h1:HTWQb7QfDc2jtHnWe2XEIEeJB7gJPnVdpNn52HXPvy8= github.com/jpillora/sizestr v1.0.0 h1:4tr0FLxs1Mtq3TnsLDV+GYUWG7Q26a6s+tV5Zfw2ygw=