Documentation ¶
Index ¶
- Constants
- Variables
- func NewConn(c net.Conn, a C.ProxyAdapter) C.Conn
- func NewSingMux(option SingMuxOption, proxy C.ProxyAdapter, base ProxyBase) (C.ProxyAdapter, error)
- func StringToBps(s string) uint64
- type Base
- func (b *Base) Addr() string
- func (b *Base) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
- func (b *Base) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (b *Base) DialOptions(opts ...dialer.Option) []dialer.Option
- func (b *Base) Id() string
- func (b *Base) IsL3Protocol(metadata *C.Metadata) bool
- func (b *Base) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (b *Base) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (b *Base) MarshalJSON() ([]byte, error)
- func (b *Base) Name() string
- func (b *Base) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (b *Base) SupportTFO() bool
- func (b *Base) SupportUDP() bool
- func (b *Base) SupportUOT() bool
- func (b *Base) SupportWithDialer() C.NetWork
- func (b *Base) SupportXUDP() bool
- func (b *Base) Type() C.AdapterType
- func (b *Base) Unwrap(metadata *C.Metadata, touch bool) C.Proxy
- type BaseOption
- type BasicOption
- type Direct
- type DirectOption
- type GrpcOptions
- type HTTP2Options
- type HTTPOptions
- type Http
- func (h *Http) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (h *Http) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (h *Http) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (h *Http) SupportWithDialer() C.NetWork
- type HttpOption
- type Hysteria
- type Hysteria2
- type Hysteria2Option
- type HysteriaOption
- type ProxyBase
- type RealityOptions
- type Reject
- type RejectOption
- type ShadowSocks
- func (ss *ShadowSocks) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (ss *ShadowSocks) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (ss *ShadowSocks) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (ss *ShadowSocks) ListenPacketOnStreamConn(ctx context.Context, c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (ss *ShadowSocks) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (ss *ShadowSocks) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (ss *ShadowSocks) SupportUOT() bool
- func (ss *ShadowSocks) SupportWithDialer() C.NetWork
- type ShadowSocksOption
- type ShadowSocksR
- func (ssr *ShadowSocksR) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (ssr *ShadowSocksR) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (ssr *ShadowSocksR) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (ssr *ShadowSocksR) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (ssr *ShadowSocksR) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (ssr *ShadowSocksR) SupportWithDialer() C.NetWork
- type ShadowSocksROption
- type SingMux
- func (s *SingMux) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (s *SingMux) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (s *SingMux) SupportUDP() bool
- func (s *SingMux) SupportUOT() bool
- type SingMuxOption
- type Snell
- func (s *Snell) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (s *Snell) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (s *Snell) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (s *Snell) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (C.PacketConn, error)
- func (s *Snell) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (s *Snell) SupportUOT() bool
- func (s *Snell) SupportWithDialer() C.NetWork
- type SnellOption
- type Socks5
- func (ss *Socks5) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (ss *Socks5) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (ss *Socks5) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (ss *Socks5) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (ss *Socks5) SupportWithDialer() C.NetWork
- type Socks5Option
- type Trojan
- func (t *Trojan) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (t *Trojan) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (t *Trojan) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (t *Trojan) ListenPacketOnStreamConn(c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (t *Trojan) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (t *Trojan) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (t *Trojan) SupportUOT() bool
- func (t *Trojan) SupportWithDialer() C.NetWork
- type TrojanOption
- type Tuic
- func (t *Tuic) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
- func (t *Tuic) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (C.Conn, error)
- func (t *Tuic) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (t *Tuic) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (t *Tuic) SupportWithDialer() C.NetWork
- type TuicOption
- type Vless
- func (v *Vless) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (v *Vless) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (v *Vless) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (v *Vless) ListenPacketOnStreamConn(ctx context.Context, c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (v *Vless) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (v *Vless) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (v *Vless) SupportUOT() bool
- func (v *Vless) SupportWithDialer() C.NetWork
- type VlessOption
- type Vmess
- func (v *Vmess) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (v *Vmess) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
- func (v *Vmess) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (v *Vmess) ListenPacketOnStreamConn(ctx context.Context, c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (v *Vmess) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
- func (v *Vmess) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (v *Vmess) SupportUOT() bool
- func (v *Vmess) SupportWithDialer() C.NetWork
- type VmessOption
- type WSOptions
- type WireGuard
- func (w *WireGuard) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (w *WireGuard) IsL3Protocol(metadata *C.Metadata) bool
- func (w *WireGuard) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- type WireGuardOption
- type WireGuardPeerOption
Constants ¶
const ( DefaultStreamReceiveWindow = 15728640 // 15 MB/s DefaultConnectionReceiveWindow = 67108864 // 64 MB/s DefaultALPN = "hysteria" DefaultProtocol = "udp" DefaultHopInterval = 10 )
Variables ¶
var ErrUDPRemoteAddrMismatch = errors.New("udp packet dropped due to mismatched remote address")
Functions ¶
func NewSingMux ¶
func NewSingMux(option SingMuxOption, proxy C.ProxyAdapter, base ProxyBase) (C.ProxyAdapter, error)
func StringToBps ¶
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func NewBase ¶
func NewBase(opt BaseOption) *Base
func (*Base) DialContext ¶
func (*Base) DialContextWithDialer ¶
func (b *Base) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*Base) DialOptions ¶
DialOptions return []dialer.Option from struct
func (*Base) IsL3Protocol ¶
IsL3Protocol implements C.ProxyAdapter
func (*Base) ListenPacketContext ¶
func (b *Base) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*Base) ListenPacketWithDialer ¶
func (b *Base) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*Base) MarshalJSON ¶
MarshalJSON implements C.ProxyAdapter
func (*Base) StreamConnContext ¶
func (b *Base) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*Base) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type BaseOption ¶
type BasicOption ¶
type BasicOption struct { TFO bool `proxy:"tfo,omitempty" group:"tfo,omitempty"` MPTCP bool `proxy:"mptcp,omitempty" group:"mptcp,omitempty"` Interface string `proxy:"interface-name,omitempty" group:"interface-name,omitempty"` RoutingMark int `proxy:"routing-mark,omitempty" group:"routing-mark,omitempty"` IPVersion string `proxy:"ip-version,omitempty" group:"ip-version,omitempty"` DialerProxy string `proxy:"dialer-proxy,omitempty"` // don't apply this option into groups, but can set a group name in a proxy }
type Direct ¶
type Direct struct {
*Base
}
func NewCompatible ¶
func NewCompatible() *Direct
func NewDirectWithOption ¶
func NewDirectWithOption(option DirectOption) *Direct
type DirectOption ¶
type DirectOption struct { BasicOption Name string `proxy:"name"` }
type GrpcOptions ¶
type GrpcOptions struct {
GrpcServiceName string `proxy:"grpc-service-name,omitempty"`
}
type HTTP2Options ¶
type HTTPOptions ¶
type Http ¶
type Http struct { *Base // contains filtered or unexported fields }
func NewHttp ¶
func NewHttp(option HttpOption) (*Http, error)
func (*Http) DialContext ¶
func (h *Http) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*Http) DialContextWithDialer ¶
func (h *Http) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*Http) StreamConnContext ¶
func (h *Http) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*Http) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type HttpOption ¶
type HttpOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` UserName string `proxy:"username,omitempty"` Password string `proxy:"password,omitempty"` TLS bool `proxy:"tls,omitempty"` SNI string `proxy:"sni,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` Headers map[string]string `proxy:"headers,omitempty"` }
type Hysteria ¶
type Hysteria struct { *Base // contains filtered or unexported fields }
func NewHysteria ¶
func NewHysteria(option HysteriaOption) (*Hysteria, error)
func (*Hysteria) DialContext ¶
type Hysteria2 ¶
type Hysteria2 struct { *Base // contains filtered or unexported fields }
func NewHysteria2 ¶
func NewHysteria2(option Hysteria2Option) (*Hysteria2, error)
func (*Hysteria2) DialContext ¶
type Hysteria2Option ¶
type Hysteria2Option struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Up string `proxy:"up,omitempty"` Down string `proxy:"down,omitempty"` Password string `proxy:"password,omitempty"` Obfs string `proxy:"obfs,omitempty"` ObfsPassword string `proxy:"obfs-password,omitempty"` SNI string `proxy:"sni,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` ALPN []string `proxy:"alpn,omitempty"` CustomCA string `proxy:"ca,omitempty"` CustomCAString string `proxy:"ca-str,omitempty"` CWND int `proxy:"cwnd,omitempty"` }
type HysteriaOption ¶
type HysteriaOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port,omitempty"` Ports string `proxy:"ports,omitempty"` Protocol string `proxy:"protocol,omitempty"` ObfsProtocol string `proxy:"obfs-protocol,omitempty"` // compatible with Stash Up string `proxy:"up"` UpSpeed int `proxy:"up-speed,omitempty"` // compatible with Stash Down string `proxy:"down"` DownSpeed int `proxy:"down-speed,omitempty"` // compatible with Stash Auth string `proxy:"auth,omitempty"` AuthString string `proxy:"auth-str,omitempty"` Obfs string `proxy:"obfs,omitempty"` SNI string `proxy:"sni,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` ALPN []string `proxy:"alpn,omitempty"` CustomCA string `proxy:"ca,omitempty"` CustomCAString string `proxy:"ca-str,omitempty"` ReceiveWindowConn int `proxy:"recv-window-conn,omitempty"` ReceiveWindow int `proxy:"recv-window,omitempty"` DisableMTUDiscovery bool `proxy:"disable-mtu-discovery,omitempty"` FastOpen bool `proxy:"fast-open,omitempty"` HopInterval int `proxy:"hop-interval,omitempty"` }
type RealityOptions ¶
type RealityOptions struct { PublicKey string `proxy:"public-key"` ShortID string `proxy:"short-id"` }
func (RealityOptions) Parse ¶
func (o RealityOptions) Parse() (*tlsC.RealityConfig, error)
type Reject ¶
type Reject struct {
*Base
}
func NewRejectWithOption ¶
func NewRejectWithOption(option RejectOption) *Reject
type RejectOption ¶
type RejectOption struct {
Name string `proxy:"name"`
}
type ShadowSocks ¶
type ShadowSocks struct { *Base // contains filtered or unexported fields }
func NewShadowSocks ¶
func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error)
func (*ShadowSocks) DialContext ¶
func (ss *ShadowSocks) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*ShadowSocks) DialContextWithDialer ¶
func (ss *ShadowSocks) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*ShadowSocks) ListenPacketContext ¶
func (ss *ShadowSocks) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*ShadowSocks) ListenPacketOnStreamConn ¶
func (ss *ShadowSocks) ListenPacketOnStreamConn(ctx context.Context, c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketOnStreamConn implements C.ProxyAdapter
func (*ShadowSocks) ListenPacketWithDialer ¶
func (ss *ShadowSocks) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*ShadowSocks) StreamConnContext ¶
func (ss *ShadowSocks) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*ShadowSocks) SupportUOT ¶
func (ss *ShadowSocks) SupportUOT() bool
SupportUOT implements C.ProxyAdapter
func (*ShadowSocks) SupportWithDialer ¶
func (ss *ShadowSocks) SupportWithDialer() C.NetWork
SupportWithDialer implements C.ProxyAdapter
type ShadowSocksOption ¶
type ShadowSocksOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Password string `proxy:"password"` Cipher string `proxy:"cipher"` UDP bool `proxy:"udp,omitempty"` Plugin string `proxy:"plugin,omitempty"` PluginOpts map[string]any `proxy:"plugin-opts,omitempty"` UDPOverTCP bool `proxy:"udp-over-tcp,omitempty"` UDPOverTCPVersion int `proxy:"udp-over-tcp-version,omitempty"` ClientFingerprint string `proxy:"client-fingerprint,omitempty"` }
type ShadowSocksR ¶
type ShadowSocksR struct { *Base // contains filtered or unexported fields }
func NewShadowSocksR ¶
func NewShadowSocksR(option ShadowSocksROption) (*ShadowSocksR, error)
func (*ShadowSocksR) DialContext ¶
func (ssr *ShadowSocksR) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*ShadowSocksR) DialContextWithDialer ¶
func (ssr *ShadowSocksR) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*ShadowSocksR) ListenPacketContext ¶
func (ssr *ShadowSocksR) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*ShadowSocksR) ListenPacketWithDialer ¶
func (ssr *ShadowSocksR) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*ShadowSocksR) StreamConnContext ¶
func (ssr *ShadowSocksR) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*ShadowSocksR) SupportWithDialer ¶
func (ssr *ShadowSocksR) SupportWithDialer() C.NetWork
SupportWithDialer implements C.ProxyAdapter
type ShadowSocksROption ¶
type ShadowSocksROption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Password string `proxy:"password"` Cipher string `proxy:"cipher"` Obfs string `proxy:"obfs"` ObfsParam string `proxy:"obfs-param,omitempty"` Protocol string `proxy:"protocol"` ProtocolParam string `proxy:"protocol-param,omitempty"` UDP bool `proxy:"udp,omitempty"` }
type SingMux ¶
type SingMux struct { C.ProxyAdapter // contains filtered or unexported fields }
func (*SingMux) DialContext ¶
func (*SingMux) ListenPacketContext ¶
func (*SingMux) SupportUDP ¶
func (*SingMux) SupportUOT ¶
type SingMuxOption ¶
type SingMuxOption struct { Enabled bool `proxy:"enabled,omitempty"` Protocol string `proxy:"protocol,omitempty"` MaxConnections int `proxy:"max-connections,omitempty"` MinStreams int `proxy:"min-streams,omitempty"` MaxStreams int `proxy:"max-streams,omitempty"` Padding bool `proxy:"padding,omitempty"` Statistic bool `proxy:"statistic,omitempty"` OnlyTcp bool `proxy:"only-tcp,omitempty"` }
type Snell ¶
type Snell struct { *Base // contains filtered or unexported fields }
func NewSnell ¶
func NewSnell(option SnellOption) (*Snell, error)
func (*Snell) DialContext ¶
func (s *Snell) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*Snell) DialContextWithDialer ¶
func (s *Snell) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*Snell) ListenPacketContext ¶
func (s *Snell) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*Snell) ListenPacketWithDialer ¶
func (s *Snell) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (C.PacketConn, error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*Snell) StreamConnContext ¶
func (s *Snell) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*Snell) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type SnellOption ¶
type Socks5 ¶
type Socks5 struct { *Base // contains filtered or unexported fields }
func NewSocks5 ¶
func NewSocks5(option Socks5Option) (*Socks5, error)
func (*Socks5) DialContext ¶
func (ss *Socks5) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*Socks5) DialContextWithDialer ¶
func (ss *Socks5) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*Socks5) ListenPacketContext ¶
func (ss *Socks5) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Socks5) StreamConnContext ¶
func (ss *Socks5) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*Socks5) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type Socks5Option ¶
type Socks5Option struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` UserName string `proxy:"username,omitempty"` Password string `proxy:"password,omitempty"` TLS bool `proxy:"tls,omitempty"` UDP bool `proxy:"udp,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` }
type Trojan ¶
type Trojan struct { *Base // contains filtered or unexported fields }
func NewTrojan ¶
func NewTrojan(option TrojanOption) (*Trojan, error)
func (*Trojan) DialContext ¶
func (t *Trojan) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*Trojan) DialContextWithDialer ¶
func (t *Trojan) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*Trojan) ListenPacketContext ¶
func (t *Trojan) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Trojan) ListenPacketOnStreamConn ¶
func (t *Trojan) ListenPacketOnStreamConn(c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketOnStreamConn implements C.ProxyAdapter
func (*Trojan) ListenPacketWithDialer ¶
func (t *Trojan) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*Trojan) StreamConnContext ¶
func (t *Trojan) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*Trojan) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type TrojanOption ¶
type TrojanOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Password string `proxy:"password"` ALPN []string `proxy:"alpn,omitempty"` SNI string `proxy:"sni,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` UDP bool `proxy:"udp,omitempty"` Network string `proxy:"network,omitempty"` RealityOpts RealityOptions `proxy:"reality-opts,omitempty"` GrpcOpts GrpcOptions `proxy:"grpc-opts,omitempty"` WSOpts WSOptions `proxy:"ws-opts,omitempty"` ClientFingerprint string `proxy:"client-fingerprint,omitempty"` }
type Tuic ¶
type Tuic struct { *Base // contains filtered or unexported fields }
func NewTuic ¶
func NewTuic(option TuicOption) (*Tuic, error)
func (*Tuic) DialContext ¶
func (t *Tuic) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
DialContext implements C.ProxyAdapter
func (*Tuic) DialContextWithDialer ¶
func (t *Tuic) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (C.Conn, error)
DialContextWithDialer implements C.ProxyAdapter
func (*Tuic) ListenPacketContext ¶
func (t *Tuic) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Tuic) ListenPacketWithDialer ¶
func (t *Tuic) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*Tuic) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type TuicOption ¶
type TuicOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Token string `proxy:"token,omitempty"` UUID string `proxy:"uuid,omitempty"` Password string `proxy:"password,omitempty"` Ip string `proxy:"ip,omitempty"` HeartbeatInterval int `proxy:"heartbeat-interval,omitempty"` ALPN []string `proxy:"alpn,omitempty"` ReduceRtt bool `proxy:"reduce-rtt,omitempty"` RequestTimeout int `proxy:"request-timeout,omitempty"` UdpRelayMode string `proxy:"udp-relay-mode,omitempty"` CongestionController string `proxy:"congestion-controller,omitempty"` DisableSni bool `proxy:"disable-sni,omitempty"` MaxUdpRelayPacketSize int `proxy:"max-udp-relay-packet-size,omitempty"` FastOpen bool `proxy:"fast-open,omitempty"` MaxOpenStreams int `proxy:"max-open-streams,omitempty"` CWND int `proxy:"cwnd,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` CustomCA string `proxy:"ca,omitempty"` CustomCAString string `proxy:"ca-str,omitempty"` ReceiveWindowConn int `proxy:"recv-window-conn,omitempty"` ReceiveWindow int `proxy:"recv-window,omitempty"` DisableMTUDiscovery bool `proxy:"disable-mtu-discovery,omitempty"` MaxDatagramFrameSize int `proxy:"max-datagram-frame-size,omitempty"` SNI string `proxy:"sni,omitempty"` UDPOverStream bool `proxy:"udp-over-stream,omitempty"` UDPOverStreamVersion int `proxy:"udp-over-stream-version,omitempty"` }
type Vless ¶
type Vless struct { *Base // contains filtered or unexported fields }
func NewVless ¶
func NewVless(option VlessOption) (*Vless, error)
func (*Vless) DialContext ¶
func (v *Vless) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*Vless) DialContextWithDialer ¶
func (v *Vless) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*Vless) ListenPacketContext ¶
func (v *Vless) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Vless) ListenPacketOnStreamConn ¶
func (v *Vless) ListenPacketOnStreamConn(ctx context.Context, c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketOnStreamConn implements C.ProxyAdapter
func (*Vless) ListenPacketWithDialer ¶
func (v *Vless) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*Vless) StreamConnContext ¶
func (*Vless) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type VlessOption ¶
type VlessOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` UUID string `proxy:"uuid"` Flow string `proxy:"flow,omitempty"` TLS bool `proxy:"tls,omitempty"` ALPN []string `proxy:"alpn,omitempty"` UDP bool `proxy:"udp,omitempty"` PacketAddr bool `proxy:"packet-addr,omitempty"` XUDP bool `proxy:"xudp,omitempty"` PacketEncoding string `proxy:"packet-encoding,omitempty"` Network string `proxy:"network,omitempty"` RealityOpts RealityOptions `proxy:"reality-opts,omitempty"` HTTPOpts HTTPOptions `proxy:"http-opts,omitempty"` HTTP2Opts HTTP2Options `proxy:"h2-opts,omitempty"` GrpcOpts GrpcOptions `proxy:"grpc-opts,omitempty"` WSOpts WSOptions `proxy:"ws-opts,omitempty"` WSPath string `proxy:"ws-path,omitempty"` WSHeaders map[string]string `proxy:"ws-headers,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` ServerName string `proxy:"servername,omitempty"` ClientFingerprint string `proxy:"client-fingerprint,omitempty"` }
type Vmess ¶
type Vmess struct { *Base // contains filtered or unexported fields }
func NewVmess ¶
func NewVmess(option VmessOption) (*Vmess, error)
func (*Vmess) DialContext ¶
func (v *Vmess) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
DialContext implements C.ProxyAdapter
func (*Vmess) DialContextWithDialer ¶
func (v *Vmess) DialContextWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.Conn, err error)
DialContextWithDialer implements C.ProxyAdapter
func (*Vmess) ListenPacketContext ¶
func (v *Vmess) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Vmess) ListenPacketOnStreamConn ¶
func (v *Vmess) ListenPacketOnStreamConn(ctx context.Context, c net.Conn, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketOnStreamConn implements C.ProxyAdapter
func (*Vmess) ListenPacketWithDialer ¶
func (v *Vmess) ListenPacketWithDialer(ctx context.Context, dialer C.Dialer, metadata *C.Metadata) (_ C.PacketConn, err error)
ListenPacketWithDialer implements C.ProxyAdapter
func (*Vmess) StreamConnContext ¶
func (v *Vmess) StreamConnContext(ctx context.Context, c net.Conn, metadata *C.Metadata) (net.Conn, error)
StreamConnContext implements C.ProxyAdapter
func (*Vmess) SupportWithDialer ¶
SupportWithDialer implements C.ProxyAdapter
type VmessOption ¶
type VmessOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` UUID string `proxy:"uuid"` AlterID int `proxy:"alterId"` Cipher string `proxy:"cipher"` UDP bool `proxy:"udp,omitempty"` Network string `proxy:"network,omitempty"` TLS bool `proxy:"tls,omitempty"` ALPN []string `proxy:"alpn,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` ServerName string `proxy:"servername,omitempty"` RealityOpts RealityOptions `proxy:"reality-opts,omitempty"` HTTPOpts HTTPOptions `proxy:"http-opts,omitempty"` HTTP2Opts HTTP2Options `proxy:"h2-opts,omitempty"` GrpcOpts GrpcOptions `proxy:"grpc-opts,omitempty"` WSOpts WSOptions `proxy:"ws-opts,omitempty"` PacketAddr bool `proxy:"packet-addr,omitempty"` XUDP bool `proxy:"xudp,omitempty"` PacketEncoding string `proxy:"packet-encoding,omitempty"` GlobalPadding bool `proxy:"global-padding,omitempty"` AuthenticatedLength bool `proxy:"authenticated-length,omitempty"` ClientFingerprint string `proxy:"client-fingerprint,omitempty"` }
type WireGuard ¶
type WireGuard struct { *Base // contains filtered or unexported fields }
func NewWireGuard ¶
func NewWireGuard(option WireGuardOption) (*WireGuard, error)
func (*WireGuard) DialContext ¶
func (*WireGuard) IsL3Protocol ¶
IsL3Protocol implements C.ProxyAdapter
type WireGuardOption ¶
type WireGuardOption struct { BasicOption WireGuardPeerOption Name string `proxy:"name"` PrivateKey string `proxy:"private-key"` Workers int `proxy:"workers,omitempty"` MTU int `proxy:"mtu,omitempty"` UDP bool `proxy:"udp,omitempty"` PersistentKeepalive int `proxy:"persistent-keepalive,omitempty"` Peers []WireGuardPeerOption `proxy:"peers,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,omitempty"` Dns []string `proxy:"dns,omitempty"` }
type WireGuardPeerOption ¶
type WireGuardPeerOption struct { Server string `proxy:"server"` Port int `proxy:"port"` Ip string `proxy:"ip,omitempty"` Ipv6 string `proxy:"ipv6,omitempty"` PublicKey string `proxy:"public-key,omitempty"` Reserved []uint8 `proxy:"reserved,omitempty"` AllowedIPs []string `proxy:"allowed-ips,omitempty"` }
func (WireGuardPeerOption) Addr ¶
func (option WireGuardPeerOption) Addr() M.Socksaddr