From 8ccafa8fbd29750c1f2f725a1920ddcb1ef42ff2 Mon Sep 17 00:00:00 2001 From: nadoo <287492+nadoo@users.noreply.github.com> Date: Tue, 14 Apr 2020 00:17:46 +0800 Subject: [PATCH] doc: update doc --- README.md | 48 ++++++++++++++++++++++++++++-------------------- proxy/dialer.go | 4 ++-- proxy/direct.go | 2 +- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 10c4198..4ea4138 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ we can set up local listeners as proxy servers, and forward requests to internet ``` ## Features -- Act as both proxy client and proxy server +- Act as both proxy client and proxy server(protocol converter) - Flexible proxy & protocol chains - Load balancing with the following scheduling algorithm: - rr: round robin @@ -38,24 +38,31 @@ we can set up local listeners as proxy servers, and forward requests to internet - Send requests from specific local ip/interface ## Protocols -|Protocol | Listen/TCP | Listen/UDP | Forward/TCP | Forward/UDP | -| :-: | :-: | :-: | :-: | :-: | -Socks5 | √ | √ | √ | √ -Socks4 | | | √ | -Http | √ | | √ | -SS | √ | √ | √ | √ -Redir | √ | | | -Tcptun | √ | | | -Udptun | | √ | | -UoTtun | | √ | | -TLS | √ | | √ | -Unix | √ | | √ | -KCP | | √ | √ | -SSR | | | √ | -VMess | | | √ | -Trojan | | | √ | √ -WebSocket | | | √ | -Simple-Obfs | | | √ | +
+click to see details + +|Protocol | Listen/TCP | Listen/UDP | Forward/TCP | Forward/UDP | Description +|:-: |:-:|:-:|:-:|:-:|:- +|ss |√|√|√|√|client & server +|ssr | | |√| |client only +|http |√| |√| |client & server +|socks4 | | |√| |client only +|socks5 |√|√|√|√|client & server +|mixed |√|√| | |http+socks5 server +|trojan | | |√|√|client only +|vmess | | |√| |client only +|redir |√| | | |linux only +|tls |√| |√| |transport client & server +|kcp | |√|√| |transport client & server +|unix |√| |√| |transport client & server +|tcptun |√| | | |transport +|udptun | |√| | |transport +|uottun | |√| | |transport +|websocket | | |√| |transport client only +|simple-obfs | | |√| |transport client only +|reject | | |√|√|reject all requests + +
## Install @@ -325,7 +332,7 @@ glider -config CONFIGPATH -listen :8080 -verbose - [transparent proxy without dnsmasq](config/examples/9.transparent_proxy_without_dnsmasq) ## Proxy & Protocol Chains -In glider, you can easily chain several proxy servers or protocols together, e.g: +
In glider, you can easily chain several proxy servers or protocols together (click to see details) - Chain proxy servers: @@ -357,6 +364,7 @@ forward=socks5://1.1.1.1:1080,tls://2.2.2.2:443,vmess://5a146038-0b56-4e95-b1dc- listen=tls://:443?cert=crtFilePath&key=keyFilePath,http:// ``` +
## Service diff --git a/proxy/dialer.go b/proxy/dialer.go index 6cdd184..bad5668 100644 --- a/proxy/dialer.go +++ b/proxy/dialer.go @@ -15,7 +15,7 @@ type Dialer interface { UDPDialer } -// TCPDialer is used to create connection. +// TCPDialer is used to create tcp connection. type TCPDialer interface { // Addr is the dialer's addr Addr() string @@ -24,7 +24,7 @@ type TCPDialer interface { Dial(network, addr string) (c net.Conn, err error) } -// UDPDialer is used to create connection. +// UDPDialer is used to create udp PacketConn. type UDPDialer interface { // Addr is the dialer's addr Addr() string diff --git a/proxy/direct.go b/proxy/direct.go index 5561376..3b0bb5b 100644 --- a/proxy/direct.go +++ b/proxy/direct.go @@ -92,7 +92,7 @@ func dial(network, addr string, localIP net.IP) (net.Conn, error) { // DialUDP connects to the given address func (d *Direct) DialUDP(network, addr string) (net.PacketConn, net.Addr, error) { // TODO: support specifying local interface - la := "" + var la string if d.ip != nil { la = d.ip.String() + ":0" }