diff --git a/README.md b/README.md index 532f03f..21aea75 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ glider -h click to see details ```bash -glider 0.10.0 usage: +glider 0.10.1 usage: -checkdisabledonly check disabled fowarders only -checkinterval int @@ -170,10 +170,10 @@ Available securities for vmess: none, aes-128-gcm, chacha20-poly1305 TLS client scheme: - tls://host:port[?skipVerify=true] + tls://host:port[?skipVerify=true][&serverName=SERVERNAME] Proxy over tls client: - tls://host:port[?skipVerify=true],scheme:// + tls://host:port[?skipVerify=true][&serverName=SERVERNAME],scheme:// tls://host:port[?skipVerify=true],http://[user:pass@] tls://host:port[?skipVerify=true],socks5://[user:pass@] tls://host:port[?skipVerify=true],vmess://[security:]uuid@?alterID=num @@ -197,7 +197,7 @@ Websocket with a specified proxy protocol: ws://host:port[/path][?host=HOST],vmess://[security:]uuid@?alterID=num TLS and Websocket with a specified proxy protocol: - tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],scheme:// + tls://host:port[?skipVerify=true][&serverName=SERVERNAME],ws://[@/path[?host=HOST]],scheme:// tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],http://[user:pass@] tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],socks5://[user:pass@] tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],vmess://[security:]uuid@?alterID=num diff --git a/conf.go b/conf.go index 54c7d68..f8f81a7 100644 --- a/conf.go +++ b/conf.go @@ -154,11 +154,11 @@ func usage() { fmt.Fprintf(w, "\n") fmt.Fprintf(w, "TLS client scheme:\n") - fmt.Fprintf(w, " tls://host:port[?skipVerify=true]\n") + fmt.Fprintf(w, " tls://host:port[?skipVerify=true][&serverName=SERVERNAME]\n") fmt.Fprintf(w, "\n") fmt.Fprintf(w, "Proxy over tls client:\n") - fmt.Fprintf(w, " tls://host:port[?skipVerify=true],scheme://\n") + fmt.Fprintf(w, " tls://host:port[?skipVerify=true][&serverName=SERVERNAME],scheme://\n") fmt.Fprintf(w, " tls://host:port[?skipVerify=true],http://[user:pass@]\n") fmt.Fprintf(w, " tls://host:port[?skipVerify=true],socks5://[user:pass@]\n") fmt.Fprintf(w, " tls://host:port[?skipVerify=true],vmess://[security:]uuid@?alterID=num\n") @@ -187,7 +187,7 @@ func usage() { fmt.Fprintf(w, "\n") fmt.Fprintf(w, "TLS and Websocket with a specified proxy protocol:\n") - fmt.Fprintf(w, " tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],scheme://\n") + fmt.Fprintf(w, " tls://host:port[?skipVerify=true][&serverName=SERVERNAME],ws://[@/path[?host=HOST]],scheme://\n") fmt.Fprintf(w, " tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],http://[user:pass@]\n") fmt.Fprintf(w, " tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],socks5://[user:pass@]\n") fmt.Fprintf(w, " tls://host:port[?skipVerify=true],ws://[@/path[?host=HOST]],vmess://[security:]uuid@?alterID=num\n") diff --git a/go.mod b/go.mod index 4eeda3c..d1e3656 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect - golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed // indirect + golang.org/x/tools v0.0.0-20200713235242-6acd2ab80ede // indirect ) // Replace dependency modules with local developing copy diff --git a/go.sum b/go.sum index 2923b4d..ee6fe04 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200425043458-8463f397d07c h1:iHhCR0b26amDCiiO+kBguKZom9aMF+NrFxh9zeKR/XU= golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed h1:+qzWo37K31KxduIYaBeMqJ8MUOyTayOQKpH9aDPLMSY= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200713235242-6acd2ab80ede h1:ItmFoZpZfJTYGsnON6247QuXEOKiKLBpieGcAgweGsk= +golang.org/x/tools v0.0.0-20200713235242-6acd2ab80ede/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/main.go b/main.go index 4debb27..daed2d2 100644 --- a/main.go +++ b/main.go @@ -33,7 +33,7 @@ import ( _ "github.com/nadoo/glider/proxy/ws" ) -var version = "0.10.0" +var version = "0.10.1" func main() { // read configs diff --git a/proxy/tls/tls.go b/proxy/tls/tls.go index a23262f..6238823 100644 --- a/proxy/tls/tls.go +++ b/proxy/tls/tls.go @@ -55,6 +55,10 @@ func NewTLS(s string, d proxy.Dialer, p proxy.Proxy) (*TLS, error) { certFile := query.Get("cert") keyFile := query.Get("key") + if customServer := query.Get("serverName"); customServer != "" { + serverName = customServer + } + t := &TLS{ dialer: d, proxy: p,