mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 09:25:41 +08:00
doc: update document for tls and unix proxy
This commit is contained in:
parent
dadaf35cb2
commit
86478d2c25
14
README.md
14
README.md
@ -110,7 +110,7 @@ glider -config CONFIGPATH -listen :8080 -verbose
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
glider v0.6.8 usage:
|
||||
glider v0.6.9 usage:
|
||||
-checkduration int
|
||||
proxy check interval(seconds) (default 30)
|
||||
-checkwebsite string
|
||||
@ -160,13 +160,15 @@ Available Schemes:
|
||||
tls: tls transport
|
||||
ws: websocket transport
|
||||
redir: redirect proxy. (used on linux as a transparent proxy with iptables redirect rules)
|
||||
redir6: redirect proxy(ipv6)
|
||||
tcptun: tcp tunnel
|
||||
udptun: udp tunnel
|
||||
uottun: udp over tcp tunnel
|
||||
unix: unix domain socket
|
||||
|
||||
Available schemes for different modes:
|
||||
listen: mixed ss socks5 http redir tcptun udptun uottun
|
||||
forward: ss socks5 http ssr vmess tls ws
|
||||
listen: mixed ss socks5 http redir redir6 tcptun udptun uottun tls unix
|
||||
forward: ss socks5 http ssr vmess tls ws unix
|
||||
|
||||
SS scheme:
|
||||
ss://method:pass@host:port
|
||||
@ -212,6 +214,9 @@ TLS and Websocket with a specified proxy protocol:
|
||||
tls://host:port[?skipVerify=true],ws://[@/path],socks5://[user:pass@]
|
||||
tls://host:port[?skipVerify=true],ws://[@/path],vmess://[security:]uuid@?alterID=num
|
||||
|
||||
Unix domain socket scheme:
|
||||
unix://path
|
||||
|
||||
DNS forwarding server:
|
||||
dns=:53
|
||||
dnsserver=8.8.8.8:53
|
||||
@ -257,6 +262,9 @@ Examples:
|
||||
glider -listen socks5://:1080 -verbose
|
||||
-listen on :1080 as a socks5 proxy server, in verbose mode.
|
||||
|
||||
glider -listen =tls://:443?cert=crtFilePath&key=keyFilePath,http:// -verbose
|
||||
-listen on :443 as a https proxy server.
|
||||
|
||||
glider -listen http://:8080 -forward socks5://127.0.0.1:1080
|
||||
-listen on :8080 as a http proxy server, forward all requests via socks5 server.
|
||||
|
||||
|
12
conf.go
12
conf.go
@ -125,11 +125,12 @@ func usage() {
|
||||
fmt.Fprintf(os.Stderr, " tcptun: tcp tunnel\n")
|
||||
fmt.Fprintf(os.Stderr, " udptun: udp tunnel\n")
|
||||
fmt.Fprintf(os.Stderr, " uottun: udp over tcp tunnel\n")
|
||||
fmt.Fprintf(os.Stderr, " unix: unix domain socket\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Available schemes for different modes:\n")
|
||||
fmt.Fprintf(os.Stderr, " listen: mixed ss socks5 http redir redir6 tcptun udptun uottun\n")
|
||||
fmt.Fprintf(os.Stderr, " forward: ss socks5 http ssr vmess tls ws\n")
|
||||
fmt.Fprintf(os.Stderr, " listen: mixed ss socks5 http redir redir6 tcptun udptun uottun tls unix\n")
|
||||
fmt.Fprintf(os.Stderr, " forward: ss socks5 http ssr vmess tls ws unix\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
|
||||
fmt.Fprintf(os.Stderr, "SS scheme:\n")
|
||||
@ -186,6 +187,10 @@ func usage() {
|
||||
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, "Unix domain socket scheme:\n")
|
||||
fmt.Fprintf(os.Stderr, " unix://path\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
|
||||
fmt.Fprintf(os.Stderr, "DNS forwarding server:\n")
|
||||
fmt.Fprintf(os.Stderr, " dns=:53\n")
|
||||
fmt.Fprintf(os.Stderr, " dnsserver=8.8.8.8:53\n")
|
||||
@ -235,6 +240,9 @@ func usage() {
|
||||
fmt.Fprintf(os.Stderr, " "+app+" -listen socks5://:1080 -verbose\n")
|
||||
fmt.Fprintf(os.Stderr, " -listen on :1080 as a socks5 proxy server, in verbose mode.\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
fmt.Fprintf(os.Stderr, " "+app+" -listen =tls://:443?cert=crtFilePath&key=keyFilePath,http:// -verbose\n")
|
||||
fmt.Fprintf(os.Stderr, " -listen on :443 as a https proxy server.\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
fmt.Fprintf(os.Stderr, " "+app+" -listen http://:8080 -forward socks5://127.0.0.1:1080\n")
|
||||
fmt.Fprintf(os.Stderr, " -listen on :8080 as a http proxy server, forward all requests via socks5 server.\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
|
@ -55,6 +55,12 @@ listen=socks5://:1080
|
||||
# listen on 1084 as a udp over tcp tunnel, all requests to :1084 will be forward to 1.1.1.1:53
|
||||
# listen=uottun://:1084=1.1.1.1:53
|
||||
|
||||
# listen on 443 with tls security layer and serve as http proxy server (HTTPS proxy)
|
||||
# listen=tls://:443?cert=crtFilePath&key=keyFilePath,http://
|
||||
|
||||
# listen on unix domain socket and serve as socks5 server
|
||||
# listen=unix:///tmp/glider.socket,socks5://
|
||||
|
||||
# FORWARDERS
|
||||
# ----------
|
||||
# Forwarders, we can setup multiple forwarders.
|
||||
|
@ -3,7 +3,6 @@ package tls
|
||||
import (
|
||||
stdtls "crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"strings"
|
||||
@ -95,9 +94,7 @@ func NewTLSServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
|
||||
// prepare transport listener
|
||||
// TODO: check here
|
||||
if len(transport) < 2 {
|
||||
err := fmt.Errorf("[tls] malformd listener: %s", s)
|
||||
log.F(err.Error())
|
||||
return nil, err
|
||||
return nil, errors.New("[tls] malformd listener:" + s)
|
||||
}
|
||||
|
||||
p, err := NewTLS(transport[0], dialer)
|
||||
|
@ -2,7 +2,6 @@ package unix
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
@ -53,9 +52,7 @@ func NewUnixServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
|
||||
// prepare transport listener
|
||||
// TODO: check here
|
||||
if len(transport) < 2 {
|
||||
err := fmt.Errorf("[unix] malformd listener: %s", s)
|
||||
log.F(err.Error())
|
||||
return nil, err
|
||||
return nil, errors.New("[unix] malformd listener:" + s)
|
||||
}
|
||||
|
||||
p, err := NewUnix(transport[0], dialer)
|
||||
|
Loading…
Reference in New Issue
Block a user