doc: update doc

This commit is contained in:
nadoo 2020-04-14 00:17:46 +08:00
parent d8b9e00025
commit 8ccafa8fbd
3 changed files with 31 additions and 23 deletions

View File

@ -15,7 +15,7 @@ we can set up local listeners as proxy servers, and forward requests to internet
``` ```
## Features ## Features
- Act as both proxy client and proxy server - Act as both proxy client and proxy server(protocol converter)
- Flexible proxy & protocol chains - Flexible proxy & protocol chains
- Load balancing with the following scheduling algorithm: - Load balancing with the following scheduling algorithm:
- rr: round robin - 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 - Send requests from specific local ip/interface
## Protocols ## Protocols
|Protocol | Listen/TCP | Listen/UDP | Forward/TCP | Forward/UDP | <details>
| :-: | :-: | :-: | :-: | :-: | <summary>click to see details</summary>
Socks5 | √ | √ | √ | √
Socks4 | | | √ | |Protocol | Listen/TCP | Listen/UDP | Forward/TCP | Forward/UDP | Description
Http | √ | | √ | |:-: |:-:|:-:|:-:|:-:|:-
SS | √ | √ | √ | √ |ss |√|√|√|√|client & server
Redir | √ | | | |ssr | | |√| |client only
Tcptun | √ | | | |http |√| |√| |client & server
Udptun | | √ | | |socks4 | | |√| |client only
UoTtun | | √ | | |socks5 |√|√|√|√|client & server
TLS | √ | | √ | |mixed |√|√| | |http+socks5 server
Unix | √ | | √ | |trojan | | |√|√|client only
KCP | | √ | √ | |vmess | | |√| |client only
SSR | | | √ | |redir |√| | | |linux only
VMess | | | √ | |tls |√| |√| |transport client & server
Trojan | | | √ | √ |kcp | |√|√| |transport client & server
WebSocket | | | √ | |unix |√| |√| |transport client & server
Simple-Obfs | | | √ | |tcptun |√| | | |transport
|udptun | |√| | |transport
|uottun | |√| | |transport
|websocket | | |√| |transport client only
|simple-obfs | | |√| |transport client only
|reject | | |√|√|reject all requests
</details>
## Install ## Install
@ -325,7 +332,7 @@ glider -config CONFIGPATH -listen :8080 -verbose
- [transparent proxy without dnsmasq](config/examples/9.transparent_proxy_without_dnsmasq) - [transparent proxy without dnsmasq](config/examples/9.transparent_proxy_without_dnsmasq)
## Proxy & Protocol Chains ## Proxy & Protocol Chains
In glider, you can easily chain several proxy servers or protocols together, e.g: <details><summary>In glider, you can easily chain several proxy servers or protocols together (click to see details)</summary>
- Chain proxy servers: - 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:// listen=tls://:443?cert=crtFilePath&key=keyFilePath,http://
``` ```
</details>
## Service ## Service

View File

@ -15,7 +15,7 @@ type Dialer interface {
UDPDialer UDPDialer
} }
// TCPDialer is used to create connection. // TCPDialer is used to create tcp connection.
type TCPDialer interface { type TCPDialer interface {
// Addr is the dialer's addr // Addr is the dialer's addr
Addr() string Addr() string
@ -24,7 +24,7 @@ type TCPDialer interface {
Dial(network, addr string) (c net.Conn, err error) 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 { type UDPDialer interface {
// Addr is the dialer's addr // Addr is the dialer's addr
Addr() string Addr() string

View File

@ -92,7 +92,7 @@ func dial(network, addr string, localIP net.IP) (net.Conn, error) {
// DialUDP connects to the given address // DialUDP connects to the given address
func (d *Direct) DialUDP(network, addr string) (net.PacketConn, net.Addr, error) { func (d *Direct) DialUDP(network, addr string) (net.PacketConn, net.Addr, error) {
// TODO: support specifying local interface // TODO: support specifying local interface
la := "" var la string
if d.ip != nil { if d.ip != nil {
la = d.ip.String() + ":0" la = d.ip.String() + ":0"
} }