mirror of
https://github.com/nadoo/glider.git
synced 2025-02-24 01:45:39 +08:00
doc: add some info for ssr
This commit is contained in:
parent
d406a8edde
commit
113a96fd18
18
README.md
18
README.md
@ -29,6 +29,7 @@ Forward (local proxy client/upstream proxy server):
|
|||||||
- Socks5 proxy(tcp&udp)
|
- Socks5 proxy(tcp&udp)
|
||||||
- Http proxy(tcp)
|
- Http proxy(tcp)
|
||||||
- SS proxy(tcp&udp&uot)
|
- SS proxy(tcp&udp&uot)
|
||||||
|
- SSR proxy(tcp)
|
||||||
|
|
||||||
DNS Forwarding Server (udp2tcp):
|
DNS Forwarding Server (udp2tcp):
|
||||||
- Listen on UDP and forward dns requests to remote dns server in TCP via forwarders
|
- 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
|
## Usage
|
||||||
```bash
|
```bash
|
||||||
glider v0.5.1 usage:
|
glider v0.5.3 usage:
|
||||||
-checkduration int
|
-checkduration int
|
||||||
proxy check duration(seconds) (default 30)
|
proxy check duration(seconds) (default 30)
|
||||||
-checkwebsite string
|
-checkwebsite string
|
||||||
@ -102,11 +103,11 @@ glider v0.5.1 usage:
|
|||||||
-dnsserver value
|
-dnsserver value
|
||||||
remote dns server
|
remote dns server
|
||||||
-forward value
|
-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 string
|
||||||
ipset name
|
ipset name
|
||||||
-listen value
|
-listen value
|
||||||
listen url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT
|
listen url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS
|
||||||
-rulefile value
|
-rulefile value
|
||||||
rule file path
|
rule file path
|
||||||
-rules-dir string
|
-rules-dir string
|
||||||
@ -129,12 +130,18 @@ Available Schemas:
|
|||||||
|
|
||||||
Available schemas for different modes:
|
Available schemas for different modes:
|
||||||
listen: mixed ss socks5 http redir tcptun udptun uottun dnstun
|
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:
|
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
|
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
|
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:
|
Available forward strategies:
|
||||||
rr: Round Robin mode
|
rr: Round Robin mode
|
||||||
ha: High Availability mode
|
ha: High Availability mode
|
||||||
@ -167,6 +174,9 @@ Examples:
|
|||||||
glider -listen redir://:1081 -forward ss://method:pass@1.1.1.1:8443
|
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.
|
-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
|
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.
|
-listen on :80 and forward all requests to 2.2.2.2:80 via remote ss server.
|
||||||
|
|
||||||
|
19
conf.go
19
conf.go
@ -34,8 +34,8 @@ func confInit() {
|
|||||||
flag.StringVar(&conf.Strategy, "strategy", "rr", "forward strategy, default: rr")
|
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.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.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.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[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT]")
|
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.StringSliceUniqVar(&conf.RuleFile, "rulefile", nil, "rule file path")
|
||||||
flag.StringVar(&conf.RulesDir, "rules-dir", "", "rule file folder")
|
flag.StringVar(&conf.RulesDir, "rules-dir", "", "rule file folder")
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ func NewRuleConfFromFile(ruleFile string) (*RuleConf, error) {
|
|||||||
p := &RuleConf{name: ruleFile}
|
p := &RuleConf{name: ruleFile}
|
||||||
|
|
||||||
f := conflag.NewFromFile("rule", 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.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.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)")
|
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, "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, " 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, "\n")
|
||||||
|
|
||||||
fmt.Fprintf(os.Stderr, "Available methods for ss:\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, " NOTE: chacha20-ietf-poly1305 = AEAD_CHACHA20_POLY1305\n")
|
||||||
fmt.Fprintf(os.Stderr, "\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, "Available forward strategies:\n")
|
||||||
fmt.Fprintf(os.Stderr, " rr: Round Robin mode\n")
|
fmt.Fprintf(os.Stderr, " rr: Round Robin mode\n")
|
||||||
fmt.Fprintf(os.Stderr, " ha: High Availability 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, " "+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, " -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, "\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, " "+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, " -listen on :80 and forward all requests to 2.2.2.2:80 via remote ss server.\n")
|
||||||
fmt.Fprintf(os.Stderr, "\n")
|
fmt.Fprintf(os.Stderr, "\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user