diff --git a/README.md b/README.md index 6f2782e..61883ea 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ Forward (local proxy client/upstream proxy server): - Http proxy(tcp) - SS proxy(tcp&udp&uot) - SSR proxy(tcp) +- VMess proxy(tcp) +- TLS, use 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 @@ -89,7 +91,7 @@ glider -config CONFIGPATH -listen :8080 -verbose ## Usage ```bash -glider v0.5.2 usage: +glider v0.6.0 usage: -checkduration int proxy check duration(seconds) (default 30) -checkwebsite string @@ -121,6 +123,7 @@ Available Schemes: socks5: socks5 proxy http: http proxy ssr: ssr proxy + vmess: vmess proxy redir: redirect proxy. (used on linux as a transparent proxy with iptables redirect rules) tcptun: tcp tunnel udptun: udp tunnel @@ -129,7 +132,7 @@ Available Schemes: Available schemes for different modes: listen: mixed ss socks5 http redir tcptun udptun uottun dnstun - forward: ss socks5 http ssr + forward: ss socks5 http ssr vmess SS scheme: ss://method:pass@host:port @@ -141,6 +144,12 @@ Available methods for ss: SSR scheme: ssr://method:pass@host:port?protocol=xxx&protocol_param=yyy&obfs=zzz&obfs_param=xyz +VMess scheme: + vmess://uuid[:method]@host:port?alterID=num + +Available methods for vmess: + NONE, (will add aes-128-gcm and chacha20-poly1305 later) + Available forward strategies: rr: Round Robin mode ha: High Availability mode @@ -176,6 +185,9 @@ Examples: 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 redir://:1081 -forward "tls://1.1.1.1:443,vmess://user:method@?alterID=10" + -listen on :1081 as a transparent redirect server, forward all requests via remote vmess 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 04418ca..e31a5b7 100644 --- a/conf.go +++ b/conf.go @@ -171,6 +171,10 @@ func usage() { fmt.Fprintf(os.Stderr, " vmess://uuid[:method]@host:port?alterID=num\n") fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, "Available methods for vmess:\n") + fmt.Fprintf(os.Stderr, " NONE, (will add aes-128-gcm and chacha20-poly1305 later)\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/examples/9.transparent_proxy_without_dnsmasq/README.md b/config/examples/9.transparent_proxy_without_dnsmasq/README.md index 4d6bd44..659bc88 100644 --- a/config/examples/9.transparent_proxy_without_dnsmasq/README.md +++ b/config/examples/9.transparent_proxy_without_dnsmasq/README.md @@ -70,7 +70,7 @@ cidr=cidr=172.16.101.0/24 cidr=cidr=172.16.102.0/24 ``` -#### Config iptables on your linux gateway +#### Configure iptables on your linux gateway ```bash iptables -t nat -I PREROUTING -p tcp -m set --match-set glider dst -j REDIRECT --to-ports 1081 iptables -t nat -I OUTPUT -p tcp -m set --match-set glider dst -j REDIRECT --to-ports 1081 diff --git a/proxy/vmess/client.go b/proxy/vmess/client.go index 515bf50..4043f4e 100644 --- a/proxy/vmess/client.go +++ b/proxy/vmess/client.go @@ -188,11 +188,11 @@ func (c *Conn) DecodeRespHeader() error { return errors.New("unexpected response header") } - // TODO: Dynamic port supported - // if buf[2] != 0 { - // cmd := buf[2] - // dataLen := int32(buf[3]) - // } + // TODO: Dynamic port support + if buf[2] != 0 { + // dataLen := int32(buf[3]) + return errors.New("dynamic port is not supported now") + } c.connected = true return nil