Documentation ¶
Index ¶
- Constants
- Variables
- func AnyAddrForUDP(ipp netip.AddrPort) (proto, anyaddr string)
- func NewAutoProxy(ctx context.Context, pxr Proxies) *auto
- func NewBaseProxy(ctx context.Context, c protect.Controller) *base
- func NewExit64Proxy(ctx context.Context, c protect.Controller) *exit64
- func NewExitProxy(ctx context.Context, c protect.Controller) *exit
- func NewGroundProxy() *ground
- func NewHTTPProxy(id string, ctx context.Context, c protect.Controller, ...) (*http1, error)
- func NewPipProxy(ctx context.Context, ctl protect.Controller, po *settings.ProxyOptions) (*piph2, error)
- func NewPipWsProxy(ctx context.Context, ctl protect.Controller, po *settings.ProxyOptions) (*pipws, error)
- func NewProxifier(pctx context.Context, c protect.Controller, o x.ProxyListener) *proxifier
- func NewSEasyProxy(ctx context.Context, c protect.Controller, sec *seasy.SEApi) (*seproxy, error)
- func NewSocks5Proxy(id string, ctx context.Context, ctl protect.Controller, ...) (_ *socks5, err error)
- func NewWgProxy(id string, ctl protect.Controller, rev netstack.GConnHandler, cfg string) (*wgproxy, error)
- func Reaches(p Proxy, hostportOrIPPortCsv string, protos ...string) bool
- func Same(a, b Proxy) bool
- type GW
- type GWNoVia
- type NoDNS
- type NoFwd
- type NoProxy
- func (NoProxy) Dial(string, string) (protect.Conn, error)
- func (NoProxy) DialBind(string, string, string) (protect.Conn, error)
- func (NoProxy) Dialer() protect.RDialer
- func (NoProxy) GetAddr() string
- func (NoProxy) Handle() uintptr
- func (NoProxy) ID() string
- func (NoProxy) Reaches(string) bool
- func (NoProxy) Router() x.Router
- func (NoProxy) Status() int
- func (NoProxy) Stop() error
- func (NoProxy) Type() string
- type NoVia
- type ProtoAgnostic
- type Proxies
- type Proxy
- type SkipRefresh
- type WgProxy
Constants ¶
const ( Block = x.Block Base = x.Base Exit = x.Exit Auto = x.Auto Ingress = x.Ingress // dummy OrbotS5 = x.OrbotS5 OrbotH1 = x.OrbotH1 GlobalH1 = x.GlobalH1 RpnWg = x.RpnWg RpnWs = x.RpnWs Rpn64 = x.Rpn64 RpnH2 = x.RpnH2 RpnSE = x.RpnSE SOCKS5 = x.SOCKS5 HTTP1 = x.HTTP1 WG = x.WG PIPH2 = x.PIPH2 PIPWS = x.PIPWS NOOP = x.NOOP INTERNET = x.INTERNET RPN = x.RPN TNT = x.TNT TZZ = x.TZZ TUP = x.TUP TOK = x.TOK TKO = x.TKO END = x.END NOMTU = 0 MAXMTU = 65535 )
const (
FAST = x.WGFAST
)
Variables ¶
var ProxyNoGateway = GWNoVia{GW: GW{/* contains filtered or unexported fields */}}
ProxyNoGateway is a Router that routes nothing.
Functions ¶
func AnyAddrForUDP ¶
func NewAutoProxy ¶
NewAutoProxy returns a new exit proxy.
func NewBaseProxy ¶
func NewBaseProxy(ctx context.Context, c protect.Controller) *base
Base returns a base proxy.
func NewExit64Proxy ¶
func NewExit64Proxy(ctx context.Context, c protect.Controller) *exit64
NewExit64Proxy returns a new exit64 proxy.
func NewExitProxy ¶
func NewExitProxy(ctx context.Context, c protect.Controller) *exit
NewExitProxy returns a new exit proxy.
func NewHTTPProxy ¶
func NewHTTPProxy(id string, ctx context.Context, c protect.Controller, po *settings.ProxyOptions) (*http1, error)
func NewPipProxy ¶
func NewPipProxy(ctx context.Context, ctl protect.Controller, po *settings.ProxyOptions) (*piph2, error)
func NewPipWsProxy ¶
func NewPipWsProxy(ctx context.Context, ctl protect.Controller, po *settings.ProxyOptions) (*pipws, error)
NewPipWsProxy creates a new pipws proxy with the given id, controller, and proxy options. The proxy options must contain a valid URL, and the URL must have a path with the format "/ws/<sha256(rsasig)>". The proxy options must also contain a valid auth user (raw client token) and password (expiry + signed raw client token).
func NewProxifier ¶
func NewProxifier(pctx context.Context, c protect.Controller, o x.ProxyListener) *proxifier
NewProxifier returns a new Proxifier instance.
func NewSEasyProxy ¶
NewSEasyProxy returns a new seproxy.
func NewSocks5Proxy ¶
func NewSocks5Proxy(id string, ctx context.Context, ctl protect.Controller, po *settings.ProxyOptions) (_ *socks5, err error)
func NewWgProxy ¶
func NewWgProxy(id string, ctl protect.Controller, rev netstack.GConnHandler, cfg string) (*wgproxy, error)
ref: github.com/WireGuard/wireguard-android/blob/713947e432/tunnel/tools/libwg-go/api-android.go#L76
Types ¶
type GW ¶
type GW struct {
// contains filtered or unexported fields
}
GW is a no-op/stub gateway that is either dualstack or not and has dummy stats.
type NoFwd ¶
type NoFwd struct{}
NoFwd is a proxy that does not support listening or forwarding.
type NoProxy ¶
type NoProxy struct { NoDNS ProtoAgnostic SkipRefresh NoFwd GWNoVia }
type ProtoAgnostic ¶
type ProtoAgnostic struct{}
ProtoAgnostic is a proxy that does not care about protocol changes.
func (ProtoAgnostic) OnProtoChange ¶
func (ProtoAgnostic) OnProtoChange() (string, bool)
OnProtoChange implements Proxy.
type Proxies ¶
type Proxies interface { x.Proxies // ProxyFor returns a transport from this multi-transport. ProxyFor(id string) (Proxy, error) // ProxyTo returns the proxy to use for ipp from given pids. ProxyTo(ipp netip.AddrPort, uid string, pids []string) (Proxy, error) // RefreshProto broadcasts proto change to all active proxies. RefreshProto(l3 string) // LiveProxies returns a csv of active proxies. LiveProxies() string // Reverser sets the reverse proxy for all proxies. Reverser(r netstack.GConnHandler) error }
type Proxy ¶
type Proxy interface { x.Proxy protect.RDialer // Dialer returns the dialer for this proxy, which is an // adapter for protect.RDialer interface, but with the caveat that // not all Proxy instances implement DialTCP and DialUDP, though are // guaranteed to implement Dial. Dialer() protect.RDialer // onProtoChange returns true if the proxy must be re-added with cfg on proto changes. OnProtoChange() (cfg string, readd bool) // Gateway sets proxy p as the gateway for this router. Hop(p Proxy) error // contains filtered or unexported methods }
type SkipRefresh ¶
type SkipRefresh struct{}
SkipRefresh is a proxy that does not need to be refreshed or pinged on network changes.