From 068e4df8fc78cd8629948dca406ba8184285cf18 Mon Sep 17 00:00:00 2001 From: nadoo <287492+nadoo@users.noreply.github.com> Date: Sun, 22 Jul 2018 20:02:50 +0800 Subject: [PATCH] doc: add some info for websocket --- README.md | 20 ++++++++++++++++++-- conf.go | 20 +++++++++++++++++++- config/glider.conf.example | 6 ++++++ dev_linux.go | 2 ++ 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 12f86a9..66feb4d 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Forward (local proxy client/upstream proxy server): - SSR proxy(tcp) - VMess proxy(tcp) - TLS, use it together with above proxy protocols(tcp) +- Websocket, use it together with above proxy protocols(tcp) DNS Forwarding Server (udp2tcp): - Listen on UDP and forward dns requests to remote dns server in TCP via forwarders @@ -91,7 +92,7 @@ glider -config CONFIGPATH -listen :8080 -verbose ## Usage ```bash -glider v0.6.2 usage: +glider v0.6.3 usage: -checkduration int proxy check duration(seconds) (default 30) -checkwebsite string @@ -132,7 +133,7 @@ Available Schemes: Available schemes for different modes: listen: mixed ss socks5 http redir tcptun udptun uottun dnstun - forward: ss socks5 http ssr vmess + forward: ss socks5 http ssr vmess tls ws SS scheme: ss://method:pass@host:port @@ -159,6 +160,21 @@ TLS with a specified proxy protocol: tls://host:port[?skipVerify=true],socks5://[user:pass@] tls://host:port[?skipVerify=true],vmess://[security:]uuid@?alterID=num +Websocket scheme: + ws://host:port[/path] + +Websocket with a specified proxy protocol: + ws://host:port[/path],proxy://scheme + ws://host:port[/path],http://[user:pass@] + ws://host:port[/path],socks5://[user:pass@] + ws://host:port[/path],vmess://[security:]uuid@?alterID=num + +TLS and Websocket with a specified proxy protocol: + tls://host:port[?skipVerify=true],ws://[@/path],proxy://scheme + tls://host:port[?skipVerify=true],ws://[@/path],http://[user:pass@] + tls://host:port[?skipVerify=true],ws://[@/path],socks5://[user:pass@] + tls://host:port[?skipVerify=true],ws://[@/path],vmess://[security:]uuid@?alterID=num + Available forward strategies: rr: Round Robin mode ha: High Availability mode diff --git a/conf.go b/conf.go index 73848ef..64ac1d3 100644 --- a/conf.go +++ b/conf.go @@ -171,7 +171,7 @@ func usage() { fmt.Fprintf(os.Stderr, "Available schemes 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 ssr vmess\n") + fmt.Fprintf(os.Stderr, " forward: ss socks5 http ssr vmess tls ws\n") fmt.Fprintf(os.Stderr, "\n") fmt.Fprintf(os.Stderr, "SS scheme:\n") @@ -207,6 +207,24 @@ func usage() { fmt.Fprintf(os.Stderr, " tls://host:port[?skipVerify=true],vmess://[security:]uuid@?alterID=num\n") fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, "Websocket scheme:\n") + fmt.Fprintf(os.Stderr, " ws://host:port[/path]\n") + fmt.Fprintf(os.Stderr, "\n") + + fmt.Fprintf(os.Stderr, "Websocket with a specified proxy protocol:\n") + fmt.Fprintf(os.Stderr, " ws://host:port[/path],proxy://scheme\n") + fmt.Fprintf(os.Stderr, " ws://host:port[/path],http://[user:pass@]\n") + fmt.Fprintf(os.Stderr, " ws://host:port[/path],socks5://[user:pass@]\n") + fmt.Fprintf(os.Stderr, " ws://host:port[/path],vmess://[security:]uuid@?alterID=num\n") + fmt.Fprintf(os.Stderr, "\n") + + fmt.Fprintf(os.Stderr, "TLS and Websocket with a specified proxy protocol:\n") + fmt.Fprintf(os.Stderr, " tls://host:port[?skipVerify=true],ws://[@/path],proxy://scheme\n") + fmt.Fprintf(os.Stderr, " tls://host:port[?skipVerify=true],ws://[@/path],http://[user:pass@]\n") + fmt.Fprintf(os.Stderr, " tls://host:port[?skipVerify=true],ws://[@/path],socks5://[user:pass@]\n") + fmt.Fprintf(os.Stderr, " tls://host:port[?skipVerify=true],ws://[@/path],vmess://[security:]uuid@?alterID=num\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") diff --git a/config/glider.conf.example b/config/glider.conf.example index 861d92e..b4fc2d7 100644 --- a/config/glider.conf.example +++ b/config/glider.conf.example @@ -83,6 +83,12 @@ listen=socks5://:1080 # vmess proxy with tls as forwarder # forward=tls://1.1.1.1:443,vmess://security:5a146038-0b56-4e95-b1dc-5c6f5a32cd98@?alterID=2 +# vmess proxy with ws as forwarder +# forward=ws://1.1.1.1:80,vmess://security:5a146038-0b56-4e95-b1dc-5c6f5a32cd98@?alterID=2 + +# vmess proxy with ws and tls as forwarder +# forward=tls://1.1.1.1:443,ws://,vmess://security:5a146038-0b56-4e95-b1dc-5c6f5a32cd98@?alterID=2 +# forward=tls://1.1.1.1:443,ws://@path,vmess://security:5a146038-0b56-4e95-b1dc-5c6f5a32cd98@?alterID=2 # FORWARDER CHAIN # --------------- diff --git a/dev_linux.go b/dev_linux.go index 1ebcfed..52e7dd3 100644 --- a/dev_linux.go +++ b/dev_linux.go @@ -1,3 +1,5 @@ +//+build dev + package main import (