Documentation ¶
Index ¶
- func IsPacketConn(c net.Conn) bool
- func NewConn(c net.Conn, a C.ProxyAdapter) C.Conn
- func NewPacketConn(pc net.PacketConn, a C.ProxyAdapter) C.PacketConn
- func WrapConn(packetConn net.PacketConn) net.Conn
- type Base
- func (b *Base) Addr() string
- func (b *Base) Cleanup()
- func (b *Base) DialOptions(opts ...dialer.Option) []dialer.Option
- func (b *Base) DisableDnsResolve() bool
- func (b *Base) ListenPacketContext(_ context.Context, _ *C.Metadata, _ ...dialer.Option) (C.PacketConn, error)
- func (b *Base) MarshalJSON() ([]byte, error)
- func (b *Base) Name() string
- func (b *Base) StreamConn(c net.Conn, _ *C.Metadata) (net.Conn, error)
- func (b *Base) StreamPacketConn(c net.Conn, _ *C.Metadata) (net.Conn, error)
- func (b *Base) SupportUDP() bool
- func (b *Base) Type() C.AdapterType
- func (b *Base) Unwrap(_ *C.Metadata) C.Proxy
- type BaseOption
- type BasicOption
- type Direct
- type GrpcOptions
- type HTTP2Options
- type HTTPOptions
- type Http
- type HttpOption
- type Hysteria2
- type Hysteria2Option
- type Mitm
- type QUICOptions
- type Reject
- type ShadowSocks
- func (ss *ShadowSocks) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (ss *ShadowSocks) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (ss *ShadowSocks) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (ss *ShadowSocks) StreamPacketConn(c net.Conn, _ *C.Metadata) (net.Conn, error)
- type ShadowSocksOption
- type ShadowSocksR
- func (ssr *ShadowSocksR) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (ssr *ShadowSocksR) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (ssr *ShadowSocksR) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (ssr *ShadowSocksR) StreamPacketConn(c net.Conn, _ *C.Metadata) (net.Conn, error)
- type ShadowSocksROption
- type Snell
- func (s *Snell) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (s *Snell) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (s *Snell) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (s *Snell) StreamPacketConn(c net.Conn, _ *C.Metadata) (net.Conn, error)
- type SnellOption
- type Socks5
- func (ss *Socks5) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (ss *Socks5) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (ss *Socks5) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (ss *Socks5) StreamSocks5PacketConn(c net.Conn, pc net.PacketConn, metadata *C.Metadata) (net.PacketConn, error)
- type Socks5Option
- type Trojan
- func (t *Trojan) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (t *Trojan) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (t *Trojan) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (t *Trojan) StreamPacketConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- type TrojanOption
- type Vless
- func (v *Vless) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (v *Vless) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (v *Vless) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (v *Vless) StreamPacketConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- type VlessOption
- type Vmess
- func (v *Vmess) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error)
- func (v *Vmess) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (v *Vmess) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- func (v *Vmess) StreamPacketConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)
- type VmessOption
- type WSOptions
- type WireGuard
- func (w *WireGuard) Cleanup()
- func (w *WireGuard) DialContext(ctx context.Context, metadata *C.Metadata, _ ...dialer.Option) (C.Conn, error)
- func (w *WireGuard) DisableDnsResolve() bool
- func (w *WireGuard) ListenPacketContext(_ context.Context, metadata *C.Metadata, _ ...dialer.Option) (C.PacketConn, error)
- func (w *WireGuard) UpdateBind()
- type WireGuardOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPacketConn ¶
func NewPacketConn ¶
func NewPacketConn(pc net.PacketConn, a C.ProxyAdapter) C.PacketConn
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func NewBase ¶
func NewBase(opt BaseOption) *Base
func (*Base) DialOptions ¶
DialOptions return []dialer.Option from struct
func (*Base) DisableDnsResolve ¶
DisableDnsResolve implements C.DisableDnsResolve
func (*Base) ListenPacketContext ¶
func (b *Base) ListenPacketContext(_ context.Context, _ *C.Metadata, _ ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*Base) MarshalJSON ¶
MarshalJSON implements C.ProxyAdapter
func (*Base) StreamConn ¶
StreamConn implements C.ProxyAdapter
func (*Base) StreamPacketConn ¶
StreamPacketConn implements C.ProxyAdapter
type BaseOption ¶
type BasicOption ¶
type Direct ¶
type Direct struct {
*Base
}
func (*Direct) DialContext ¶
func (d *Direct) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
DialContext implements C.ProxyAdapter
func (*Direct) DisableDnsResolve ¶
DisableDnsResolve implements C.DisableDnsResolve
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
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"` Headers map[string]string `proxy:"headers,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,omitempty"` }
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,omitempty"` Ports string `proxy:"ports,omitempty"` Password string `proxy:"password"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` SNI string `proxy:"sni,omitempty"` PinSHA256 string `proxy:"pin-sha256,omitempty"` Fingerprint string `proxy:"fingerprint,omitempty"` Obfs string `proxy:"obfs,omitempty"` ObfsParam string `proxy:"obfs-param,omitempty"` HopInterval time.Duration `proxy:"hop-interval,omitempty"` Up string `proxy:"up,omitempty"` Down string `proxy:"down,omitempty"` UDP bool `proxy:"udp,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,omitempty"` }
type QUICOptions ¶
type Reject ¶
type Reject struct {
*Base
}
func NewRejectByName ¶
func (*Reject) DialContext ¶
func (r *Reject) DialContext(_ context.Context, metadata *C.Metadata, _ ...dialer.Option) (C.Conn, error)
DialContext implements C.ProxyAdapter
func (*Reject) DisableDnsResolve ¶
DisableDnsResolve implements C.DisableDnsResolve
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) ListenPacketContext ¶
func (ss *ShadowSocks) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*ShadowSocks) StreamConn ¶
StreamConn implements C.ProxyAdapter
func (*ShadowSocks) StreamPacketConn ¶
StreamPacketConn 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"` RandomHost bool `proxy:"rand-host,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,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) ListenPacketContext ¶
func (ssr *ShadowSocksR) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*ShadowSocksR) StreamConn ¶
StreamConn implements C.ProxyAdapter
func (*ShadowSocksR) StreamPacketConn ¶
StreamPacketConn 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"` RandomHost bool `proxy:"rand-host,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,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) ListenPacketContext ¶
func (s *Snell) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*Snell) StreamConn ¶
StreamConn implements C.ProxyAdapter
type SnellOption ¶
type SnellOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` Psk string `proxy:"psk"` UDP bool `proxy:"udp,omitempty"` Version int `proxy:"version,omitempty"` ObfsOpts map[string]any `proxy:"obfs-opts,omitempty"` RandomHost bool `proxy:"rand-host,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,omitempty"` }
type Socks5 ¶
type Socks5 struct { *Base // contains filtered or unexported fields }
func NewSocks5 ¶
func NewSocks5(option Socks5Option) *Socks5
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) ListenPacketContext ¶
func (ss *Socks5) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Socks5) StreamConn ¶
StreamConn implements C.ProxyAdapter
func (*Socks5) StreamSocks5PacketConn ¶
func (ss *Socks5) StreamSocks5PacketConn(c net.Conn, pc net.PacketConn, metadata *C.Metadata) (net.PacketConn, error)
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"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,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) ListenPacketContext ¶
func (t *Trojan) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Trojan) StreamConn ¶
StreamConn 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"` UDP bool `proxy:"udp,omitempty"` Network string `proxy:"network,omitempty"` GrpcOpts GrpcOptions `proxy:"grpc-opts,omitempty"` WSOpts WSOptions `proxy:"ws-opts,omitempty"` HTTP2Opts HTTP2Options `proxy:"h2-opts,omitempty"` QUICOpts QUICOptions `proxy:"quic-opts,omitempty"` AEADOpts crypto.AEADOption `proxy:"aead-opts,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,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) ListenPacketContext ¶
func (v *Vless) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Vless) StreamConn ¶
StreamConn 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"` UDP bool `proxy:"udp,omitempty"` Network string `proxy:"network,omitempty"` TLS bool `proxy:"tls,omitempty"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` ALPN []string `proxy:"alpn,omitempty"` ServerName string `proxy:"servername,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"` QUICOpts QUICOptions `proxy:"quic-opts,omitempty"` AEADOpts crypto.AEADOption `proxy:"aead-opts,omitempty"` RandomHost bool `proxy:"rand-host,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,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) ListenPacketContext ¶
func (v *Vmess) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
ListenPacketContext implements C.ProxyAdapter
func (*Vmess) StreamConn ¶
StreamConn 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"` SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` ALPN []string `proxy:"alpn,omitempty"` ServerName string `proxy:"servername,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"` QUICOpts QUICOptions `proxy:"quic-opts,omitempty"` RandomHost bool `proxy:"rand-host,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,omitempty"` }
type WireGuard ¶
type WireGuard struct { *Base // contains filtered or unexported fields }
func NewWireGuard ¶
func NewWireGuard(option WireGuardOption) (*WireGuard, error)
func (*WireGuard) DialContext ¶
func (w *WireGuard) DialContext(ctx context.Context, metadata *C.Metadata, _ ...dialer.Option) (C.Conn, error)
DialContext implements C.ProxyAdapter
func (*WireGuard) DisableDnsResolve ¶
DisableDnsResolve implements C.DisableDnsResolve
func (*WireGuard) ListenPacketContext ¶
func (w *WireGuard) ListenPacketContext(_ context.Context, metadata *C.Metadata, _ ...dialer.Option) (C.PacketConn, error)
ListenPacketContext implements C.ProxyAdapter
func (*WireGuard) UpdateBind ¶
func (w *WireGuard) UpdateBind()
type WireGuardOption ¶
type WireGuardOption struct { BasicOption Name string `proxy:"name"` Server string `proxy:"server"` Port int `proxy:"port"` IP string `proxy:"ip,omitempty"` IPv6 string `proxy:"ipv6,omitempty"` PrivateKey string `proxy:"private-key"` PublicKey string `proxy:"public-key"` DNS []string `proxy:"dns,omitempty"` MTU int `proxy:"mtu,omitempty"` UDP bool `proxy:"udp,omitempty"` RemoteDnsResolve bool `proxy:"remote-dns-resolve,omitempty"` Reserved string `proxy:"reserved,omitempty"` }