Versions in this module Expand all Collapse all v1 v1.18.1 Nov 3, 2023 Changes in this version + var ErrUDPRemoteAddrMismatch = errors.New("udp packet dropped due to mismatched remote address") + func NewConn(c net.Conn, a C.ProxyAdapter) C.Conn + type Base struct + func NewBase(opt BaseOption) *Base + func (b *Base) Addr() string + func (b *Base) DialOptions(opts ...dialer.Option) []dialer.Option + func (b *Base) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error) + func (b *Base) MarshalJSON() ([]byte, error) + func (b *Base) Name() string + func (b *Base) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error) + func (b *Base) SupportUDP() bool + func (b *Base) Type() C.AdapterType + func (b *Base) Unwrap(metadata *C.Metadata) C.Proxy + type BaseOption struct + Addr string + Interface string + Name string + RoutingMark int + Type C.AdapterType + UDP bool + type BasicOption struct + Interface string + RoutingMark int + type Direct struct + func NewDirect() *Direct + func (d *Direct) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error) + func (d *Direct) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error) + type GrpcOptions struct + GrpcServiceName string + type HTTP2Options struct + Host []string + Path string + type HTTPOptions struct + Headers map[string][]string + Method string + Path []string + type Http struct + Headers http.Header + func NewHttp(option HttpOption) *Http + func (h *Http) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error) + func (h *Http) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error) + type HttpOption struct + Headers map[string]string + Name string + Password string + Port int + SNI string + Server string + SkipCertVerify bool + TLS bool + UserName string + type Reject struct + func NewReject() *Reject + func (r *Reject) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error) + func (r *Reject) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error) + type ShadowSocks struct + func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error) + 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) + type ShadowSocksOption struct + Cipher string + Name string + Password string + Plugin string + PluginOpts map[string]any + Port int + Server string + UDP bool + type ShadowSocksR struct + func NewShadowSocksR(option ShadowSocksROption) (*ShadowSocksR, error) + 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) + type ShadowSocksROption struct + Cipher string + Name string + Obfs string + ObfsParam string + Password string + Port int + Protocol string + ProtocolParam string + Server string + UDP bool + type Snell struct + func NewSnell(option SnellOption) (*Snell, error) + 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) + type SnellOption struct + Name string + ObfsOpts map[string]any + Port int + Psk string + Server string + UDP bool + Version int + type Socks5 struct + func NewSocks5(option Socks5Option) *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) + type Socks5Option struct + Name string + Password string + Port int + Server string + SkipCertVerify bool + TLS bool + UDP bool + UserName string + type Trojan struct + func NewTrojan(option TrojanOption) (*Trojan, error) + 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) + type TrojanOption struct + ALPN []string + GrpcOpts GrpcOptions + Name string + Network string + Password string + Port int + SNI string + Server string + SkipCertVerify bool + UDP bool + WSOpts WSOptions + type Vless = Vmess + func NewVless(option VlessOption) (*Vless, error) + type VlessOption = VmessOption + type Vmess struct + func NewVmess(option VmessOption) (*Vmess, error) + 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) + type VmessOption struct + AlterID int + Cipher string + GrpcOpts GrpcOptions + HTTP2Opts HTTP2Options + HTTPOpts HTTPOptions + Name string + Network string + Port int + Server string + ServerName string + SkipCertVerify bool + TLS bool + UDP bool + UUID string + WSOpts WSOptions + type WSOptions struct + EarlyDataHeaderName string + Headers map[string]string + MaxEarlyData int + Path string