mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +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
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
glider v0.6.8 usage:
|
glider v0.6.9 usage:
|
||||||
-checkduration int
|
-checkduration int
|
||||||
proxy check interval(seconds) (default 30)
|
proxy check interval(seconds) (default 30)
|
||||||
-checkwebsite string
|
-checkwebsite string
|
||||||
@ -160,13 +160,15 @@ Available Schemes:
|
|||||||
tls: tls transport
|
tls: tls transport
|
||||||
ws: websocket transport
|
ws: websocket transport
|
||||||
redir: redirect proxy. (used on linux as a transparent proxy with iptables redirect rules)
|
redir: redirect proxy. (used on linux as a transparent proxy with iptables redirect rules)
|
||||||
|
redir6: redirect proxy(ipv6)
|
||||||
tcptun: tcp tunnel
|
tcptun: tcp tunnel
|
||||||
udptun: udp tunnel
|
udptun: udp tunnel
|
||||||
uottun: udp over tcp tunnel
|
uottun: udp over tcp tunnel
|
||||||
|
unix: unix domain socket
|
||||||
|
|
||||||
Available schemes for different modes:
|
Available schemes for different modes:
|
||||||
listen: mixed ss socks5 http redir tcptun udptun uottun
|
listen: mixed ss socks5 http redir redir6 tcptun udptun uottun tls unix
|
||||||
forward: ss socks5 http ssr vmess tls ws
|
forward: ss socks5 http ssr vmess tls ws unix
|
||||||
|
|
||||||
SS scheme:
|
SS scheme:
|
||||||
ss://method:pass@host:port
|
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],socks5://[user:pass@]
|
||||||
tls://host:port[?skipVerify=true],ws://[@/path],vmess://[security:]uuid@?alterID=num
|
tls://host:port[?skipVerify=true],ws://[@/path],vmess://[security:]uuid@?alterID=num
|
||||||
|
|
||||||
|
Unix domain socket scheme:
|
||||||
|
unix://path
|
||||||
|
|
||||||
DNS forwarding server:
|
DNS forwarding server:
|
||||||
dns=:53
|
dns=:53
|
||||||
dnsserver=8.8.8.8:53
|
dnsserver=8.8.8.8:53
|
||||||
@ -257,6 +262,9 @@ Examples:
|
|||||||
glider -listen socks5://:1080 -verbose
|
glider -listen socks5://:1080 -verbose
|
||||||
-listen on :1080 as a socks5 proxy server, in verbose mode.
|
-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
|
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.
|
-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, " tcptun: tcp tunnel\n")
|
||||||
fmt.Fprintf(os.Stderr, " udptun: udp tunnel\n")
|
fmt.Fprintf(os.Stderr, " udptun: udp tunnel\n")
|
||||||
fmt.Fprintf(os.Stderr, " uottun: udp over tcp 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, "\n")
|
||||||
|
|
||||||
fmt.Fprintf(os.Stderr, "Available schemes for different modes:\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, " 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\n")
|
fmt.Fprintf(os.Stderr, " forward: ss socks5 http ssr vmess tls ws unix\n")
|
||||||
fmt.Fprintf(os.Stderr, "\n")
|
fmt.Fprintf(os.Stderr, "\n")
|
||||||
|
|
||||||
fmt.Fprintf(os.Stderr, "SS scheme:\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, " tls://host:port[?skipVerify=true],ws://[@/path],vmess://[security:]uuid@?alterID=num\n")
|
||||||
fmt.Fprintf(os.Stderr, "\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 forwarding server:\n")
|
||||||
fmt.Fprintf(os.Stderr, " dns=:53\n")
|
fmt.Fprintf(os.Stderr, " dns=:53\n")
|
||||||
fmt.Fprintf(os.Stderr, " dnsserver=8.8.8.8: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, " "+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, " -listen on :1080 as a socks5 proxy server, in verbose mode.\n")
|
||||||
fmt.Fprintf(os.Stderr, "\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, " "+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, " -listen on :8080 as a http proxy server, forward all requests via socks5 server.\n")
|
||||||
fmt.Fprintf(os.Stderr, "\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 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=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
|
||||||
# ----------
|
# ----------
|
||||||
# Forwarders, we can setup multiple forwarders.
|
# Forwarders, we can setup multiple forwarders.
|
||||||
|
@ -3,7 +3,6 @@ package tls
|
|||||||
import (
|
import (
|
||||||
stdtls "crypto/tls"
|
stdtls "crypto/tls"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
@ -95,9 +94,7 @@ func NewTLSServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
|
|||||||
// prepare transport listener
|
// prepare transport listener
|
||||||
// TODO: check here
|
// TODO: check here
|
||||||
if len(transport) < 2 {
|
if len(transport) < 2 {
|
||||||
err := fmt.Errorf("[tls] malformd listener: %s", s)
|
return nil, errors.New("[tls] malformd listener:" + s)
|
||||||
log.F(err.Error())
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := NewTLS(transport[0], dialer)
|
p, err := NewTLS(transport[0], dialer)
|
||||||
|
@ -2,7 +2,6 @@ package unix
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@ -53,9 +52,7 @@ func NewUnixServer(s string, dialer proxy.Dialer) (proxy.Server, error) {
|
|||||||
// prepare transport listener
|
// prepare transport listener
|
||||||
// TODO: check here
|
// TODO: check here
|
||||||
if len(transport) < 2 {
|
if len(transport) < 2 {
|
||||||
err := fmt.Errorf("[unix] malformd listener: %s", s)
|
return nil, errors.New("[unix] malformd listener:" + s)
|
||||||
log.F(err.Error())
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := NewUnix(transport[0], dialer)
|
p, err := NewUnix(transport[0], dialer)
|
||||||
|
Loading…
Reference in New Issue
Block a user