From 113a96fd18e2cd1ad503636fcb45ee596159d76b Mon Sep 17 00:00:00 2001 From: nadoo <287492+nadoo@users.noreply.github.com> Date: Thu, 17 May 2018 10:16:00 +0800 Subject: [PATCH] doc: add some info for ssr --- README.md | 18 ++++++++++++++---- conf.go | 19 +++++++++++++++---- main.go | 2 +- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f128827..5d819ec 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Forward (local proxy client/upstream proxy server): - Socks5 proxy(tcp&udp) - Http proxy(tcp) - SS proxy(tcp&udp&uot) +- SSR proxy(tcp) DNS Forwarding Server (udp2tcp): - Listen on UDP and forward dns requests to remote dns server in TCP via forwarders @@ -90,7 +91,7 @@ glider -config CONFIGPATH -listen :8080 -verbose ## Usage ```bash -glider v0.5.1 usage: +glider v0.5.3 usage: -checkduration int proxy check duration(seconds) (default 30) -checkwebsite string @@ -102,11 +103,11 @@ glider v0.5.1 usage: -dnsserver value remote dns server -forward value - forward url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT] + forward url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS] -ipset string ipset name -listen value - listen url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT + listen url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS -rulefile value rule file path -rules-dir string @@ -129,12 +130,18 @@ Available Schemas: Available schemas for different modes: listen: mixed ss socks5 http redir tcptun udptun uottun dnstun - forward: ss socks5 http + forward: ss socks5 http ssr + +SS schema: + ss://method:pass@host:port Available methods for ss: AEAD_AES_128_GCM AEAD_AES_192_GCM AEAD_AES_256_GCM AEAD_CHACHA20_POLY1305 AES-128-CFB AES-128-CTR AES-192-CFB AES-192-CTR AES-256-CFB AES-256-CTR CHACHA20-IETF XCHACHA20 NOTE: chacha20-ietf-poly1305 = AEAD_CHACHA20_POLY1305 +SSR schema: + ssr://method:pass@host:port?protocol=xxx&protocol_param=yyy&obfs=zzz&obfs_param=xyz + Available forward strategies: rr: Round Robin mode ha: High Availability mode @@ -167,6 +174,9 @@ Examples: glider -listen redir://:1081 -forward ss://method:pass@1.1.1.1:8443 -listen on :1081 as a transparent redirect server, forward all requests via remote ss server. + glider -listen redir://:1081 -forward ssr://method:pass@1.1.1.1:8444?protocol=a&protocol_param=b&obfs=c&obfs_param=d + -listen on :1081 as a transparent redirect server, forward all requests via remote ssr server. + glider -listen tcptun://:80=2.2.2.2:80 -forward ss://method:pass@1.1.1.1:8443 -listen on :80 and forward all requests to 2.2.2.2:80 via remote ss server. diff --git a/conf.go b/conf.go index f20ce5b..094c125 100644 --- a/conf.go +++ b/conf.go @@ -34,8 +34,8 @@ func confInit() { flag.StringVar(&conf.Strategy, "strategy", "rr", "forward strategy, default: rr") flag.StringVar(&conf.CheckWebSite, "checkwebsite", "www.apple.com", "proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80") flag.IntVar(&conf.CheckDuration, "checkduration", 30, "proxy check duration(seconds)") - flag.StringSliceUniqVar(&conf.Listen, "listen", nil, "listen url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT") - flag.StringSliceUniqVar(&conf.Forward, "forward", nil, "forward url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT]") + flag.StringSliceUniqVar(&conf.Listen, "listen", nil, "listen url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS") + flag.StringSliceUniqVar(&conf.Forward, "forward", nil, "forward url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]") flag.StringSliceUniqVar(&conf.RuleFile, "rulefile", nil, "rule file path") flag.StringVar(&conf.RulesDir, "rules-dir", "", "rule file folder") @@ -106,7 +106,7 @@ func NewRuleConfFromFile(ruleFile string) (*RuleConf, error) { p := &RuleConf{name: ruleFile} f := conflag.NewFromFile("rule", ruleFile) - f.StringSliceUniqVar(&p.Forward, "forward", nil, "forward url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT]") + f.StringSliceUniqVar(&p.Forward, "forward", nil, "forward url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]") f.StringVar(&p.Strategy, "strategy", "rr", "forward strategy, default: rr") f.StringVar(&p.CheckWebSite, "checkwebsite", "www.apple.com", "proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80") f.IntVar(&p.CheckDuration, "checkduration", 30, "proxy check duration(seconds)") @@ -148,7 +148,11 @@ func usage() { fmt.Fprintf(os.Stderr, "Available schemas for different modes:\n") fmt.Fprintf(os.Stderr, " listen: mixed ss socks5 http redir tcptun udptun uottun dnstun\n") - fmt.Fprintf(os.Stderr, " forward: ss socks5 http\n") + fmt.Fprintf(os.Stderr, " forward: ss socks5 http ssr\n") + fmt.Fprintf(os.Stderr, "\n") + + fmt.Fprintf(os.Stderr, "SS schema:\n") + fmt.Fprintf(os.Stderr, " ss://method:pass@host:port\n") fmt.Fprintf(os.Stderr, "\n") fmt.Fprintf(os.Stderr, "Available methods for ss:\n") @@ -157,6 +161,10 @@ func usage() { fmt.Fprintf(os.Stderr, " NOTE: chacha20-ietf-poly1305 = AEAD_CHACHA20_POLY1305\n") fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, "SSR schema:\n") + fmt.Fprintf(os.Stderr, " ssr://method:pass@host:port?protocol=xxx&protocol_param=yyy&obfs=zzz&obfs_param=xyz\n") + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, "Available forward strategies:\n") fmt.Fprintf(os.Stderr, " rr: Round Robin mode\n") fmt.Fprintf(os.Stderr, " ha: High Availability mode\n") @@ -191,6 +199,9 @@ func usage() { fmt.Fprintf(os.Stderr, " "+app+" -listen redir://:1081 -forward ss://method:pass@1.1.1.1:8443\n") fmt.Fprintf(os.Stderr, " -listen on :1081 as a transparent redirect server, forward all requests via remote ss server.\n") fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, " "+app+" -listen redir://:1081 -forward ssr://method:pass@1.1.1.1:8444?protocol=a&protocol_param=b&obfs=c&obfs_param=d\n") + fmt.Fprintf(os.Stderr, " -listen on :1081 as a transparent redirect server, forward all requests via remote ssr server.\n") + fmt.Fprintf(os.Stderr, "\n") fmt.Fprintf(os.Stderr, " "+app+" -listen tcptun://:80=2.2.2.2:80 -forward ss://method:pass@1.1.1.1:8443\n") fmt.Fprintf(os.Stderr, " -listen on :80 and forward all requests to 2.2.2.2:80 via remote ss server.\n") fmt.Fprintf(os.Stderr, "\n") diff --git a/main.go b/main.go index 5c80aea..3a5ec29 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( ) // VERSION . -const VERSION = "0.5.2" +const VERSION = "0.5.3" func dialerFromConf() Dialer { // global forwarders in xx.conf