inbound

package
v1.18.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2024 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthUser added in v1.18.8

type AuthUser struct {
	Username string `inbound:"username"`
	Password string `inbound:"password"`
}

type AuthUsers added in v1.18.8

type AuthUsers []AuthUser

func (AuthUsers) GetAuthStore added in v1.18.9

func (a AuthUsers) GetAuthStore() auth.AuthStore

type Base

type Base struct {
	// contains filtered or unexported fields
}

func NewBase

func NewBase(options *BaseOption) (*Base, error)

func (*Base) Additions

func (b *Base) Additions() []inbound.Addition

func (*Base) Address

func (b *Base) Address() string

Address implements constant.InboundListener

func (*Base) Close

func (*Base) Close() error

Close implements constant.InboundListener

func (*Base) Config

func (b *Base) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Base) Listen

func (*Base) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

func (*Base) Name

func (b *Base) Name() string

Name implements constant.InboundListener

func (*Base) RawAddress

func (b *Base) RawAddress() string

RawAddress implements constant.InboundListener

type BaseOption

type BaseOption struct {
	NameStr      string `inbound:"name"`
	Listen       string `inbound:"listen,omitempty"`
	Port         int    `inbound:"port,omitempty"`
	SpecialRules string `inbound:"rule,omitempty"`
	SpecialProxy string `inbound:"proxy,omitempty"`
}

func (BaseOption) Additions

func (o BaseOption) Additions() []inbound.Addition

func (BaseOption) Equal

func (o BaseOption) Equal(config C.InboundConfig) bool

func (BaseOption) Name

func (o BaseOption) Name() string

type BrutalOptions

type BrutalOptions struct {
	Enabled bool   `inbound:"enabled,omitempty"`
	Up      string `inbound:"up,omitempty"`
	Down    string `inbound:"down,omitempty"`
}

type HTTP

type HTTP struct {
	*Base
	// contains filtered or unexported fields
}

func NewHTTP

func NewHTTP(options *HTTPOption) (*HTTP, error)

func (*HTTP) Address

func (h *HTTP) Address() string

Address implements constant.InboundListener

func (*HTTP) Close

func (h *HTTP) Close() error

Close implements constant.InboundListener

func (*HTTP) Config

func (h *HTTP) Config() C.InboundConfig

Config implements constant.InboundListener

func (*HTTP) Listen

func (h *HTTP) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type HTTPOption

type HTTPOption struct {
	BaseOption
	Users AuthUsers `inbound:"users,omitempty"`
}

func (HTTPOption) Equal

func (o HTTPOption) Equal(config C.InboundConfig) bool

type Hysteria2

type Hysteria2 struct {
	*Base
	// contains filtered or unexported fields
}

func NewHysteria2

func NewHysteria2(options *Hysteria2Option) (*Hysteria2, error)

func (*Hysteria2) Address

func (t *Hysteria2) Address() string

Address implements constant.InboundListener

func (*Hysteria2) Close

func (t *Hysteria2) Close() error

Close implements constant.InboundListener

func (*Hysteria2) Config

func (t *Hysteria2) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Hysteria2) Listen

func (t *Hysteria2) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type Hysteria2Option

type Hysteria2Option struct {
	BaseOption
	Users                 map[string]string `inbound:"users,omitempty"`
	Obfs                  string            `inbound:"obfs,omitempty"`
	ObfsPassword          string            `inbound:"obfs-password,omitempty"`
	Certificate           string            `inbound:"certificate"`
	PrivateKey            string            `inbound:"private-key"`
	MaxIdleTime           int               `inbound:"max-idle-time,omitempty"`
	ALPN                  []string          `inbound:"alpn,omitempty"`
	Up                    string            `inbound:"up,omitempty"`
	Down                  string            `inbound:"down,omitempty"`
	IgnoreClientBandwidth bool              `inbound:"ignore-client-bandwidth,omitempty"`
	Masquerade            string            `inbound:"masquerade,omitempty"`
	CWND                  int               `inbound:"cwnd,omitempty"`
	UdpMTU                int               `inbound:"udp-mtu,omitempty"`
	MuxOption             MuxOption         `inbound:"mux-option,omitempty"`
}

func (Hysteria2Option) Equal

func (o Hysteria2Option) Equal(config C.InboundConfig) bool

type Mixed

type Mixed struct {
	*Base
	// contains filtered or unexported fields
}

func NewMixed

func NewMixed(options *MixedOption) (*Mixed, error)

func (*Mixed) Address

func (m *Mixed) Address() string

Address implements constant.InboundListener

func (*Mixed) Close

func (m *Mixed) Close() error

Close implements constant.InboundListener

func (*Mixed) Config

func (m *Mixed) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Mixed) Listen

func (m *Mixed) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type MixedOption

type MixedOption struct {
	BaseOption
	Users AuthUsers `inbound:"users,omitempty"`
	UDP   bool      `inbound:"udp,omitempty"`
}

func (MixedOption) Equal

func (o MixedOption) Equal(config C.InboundConfig) bool

type MuxOption

type MuxOption struct {
	Padding bool          `inbound:"padding,omitempty"`
	Brutal  BrutalOptions `inbound:"brutal,omitempty"`
}

func (MuxOption) Build

func (m MuxOption) Build() sing.MuxOption

type Redir

type Redir struct {
	*Base
	// contains filtered or unexported fields
}

func NewRedir

func NewRedir(options *RedirOption) (*Redir, error)

func (*Redir) Address

func (r *Redir) Address() string

Address implements constant.InboundListener

func (*Redir) Close

func (r *Redir) Close() error

Close implements constant.InboundListener

func (*Redir) Config

func (r *Redir) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Redir) Listen

func (r *Redir) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type RedirOption

type RedirOption struct {
	BaseOption
}

func (RedirOption) Equal

func (o RedirOption) Equal(config C.InboundConfig) bool

type ShadowSocks

type ShadowSocks struct {
	*Base
	// contains filtered or unexported fields
}

func NewShadowSocks

func NewShadowSocks(options *ShadowSocksOption) (*ShadowSocks, error)

func (*ShadowSocks) Address

func (s *ShadowSocks) Address() string

Address implements constant.InboundListener

func (*ShadowSocks) Close

func (s *ShadowSocks) Close() error

Close implements constant.InboundListener

func (*ShadowSocks) Config

func (s *ShadowSocks) Config() C.InboundConfig

Config implements constant.InboundListener

func (*ShadowSocks) Listen

func (s *ShadowSocks) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type ShadowSocksOption

type ShadowSocksOption struct {
	BaseOption
	Password  string    `inbound:"password"`
	Cipher    string    `inbound:"cipher"`
	UDP       bool      `inbound:"udp,omitempty"`
	MuxOption MuxOption `inbound:"mux-option,omitempty"`
}

func (ShadowSocksOption) Equal

func (o ShadowSocksOption) Equal(config C.InboundConfig) bool

type Socks

type Socks struct {
	*Base
	// contains filtered or unexported fields
}

func NewSocks

func NewSocks(options *SocksOption) (*Socks, error)

func (*Socks) Address

func (s *Socks) Address() string

Address implements constant.InboundListener

func (*Socks) Close

func (s *Socks) Close() error

Close implements constant.InboundListener

func (*Socks) Config

func (s *Socks) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Socks) Listen

func (s *Socks) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type SocksOption

type SocksOption struct {
	BaseOption
	Users AuthUsers `inbound:"users,omitempty"`
	UDP   bool      `inbound:"udp,omitempty"`
}

func (SocksOption) Equal

func (o SocksOption) Equal(config C.InboundConfig) bool

type TProxy

type TProxy struct {
	*Base
	// contains filtered or unexported fields
}

func NewTProxy

func NewTProxy(options *TProxyOption) (*TProxy, error)

func (*TProxy) Address

func (t *TProxy) Address() string

Address implements constant.InboundListener

func (*TProxy) Close

func (t *TProxy) Close() error

Close implements constant.InboundListener

func (*TProxy) Config

func (t *TProxy) Config() C.InboundConfig

Config implements constant.InboundListener

func (*TProxy) Listen

func (t *TProxy) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type TProxyOption

type TProxyOption struct {
	BaseOption
	UDP bool `inbound:"udp,omitempty"`
}

func (TProxyOption) Equal

func (o TProxyOption) Equal(config C.InboundConfig) bool

type Tuic

type Tuic struct {
	*Base
	// contains filtered or unexported fields
}

func NewTuic

func NewTuic(options *TuicOption) (*Tuic, error)

func (*Tuic) Address

func (t *Tuic) Address() string

Address implements constant.InboundListener

func (*Tuic) Close

func (t *Tuic) Close() error

Close implements constant.InboundListener

func (*Tuic) Config

func (t *Tuic) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Tuic) Listen

func (t *Tuic) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type TuicOption

type TuicOption struct {
	BaseOption
	Token                 []string          `inbound:"token,omitempty"`
	Users                 map[string]string `inbound:"users,omitempty"`
	Certificate           string            `inbound:"certificate"`
	PrivateKey            string            `inbound:"private-key"`
	CongestionController  string            `inbound:"congestion-controller,omitempty"`
	MaxIdleTime           int               `inbound:"max-idle-time,omitempty"`
	AuthenticationTimeout int               `inbound:"authentication-timeout,omitempty"`
	ALPN                  []string          `inbound:"alpn,omitempty"`
	MaxUdpRelayPacketSize int               `inbound:"max-udp-relay-packet-size,omitempty"`
	CWND                  int               `inbound:"cwnd,omitempty"`
	MuxOption             MuxOption         `inbound:"mux-option,omitempty"`
}

func (TuicOption) Equal

func (o TuicOption) Equal(config C.InboundConfig) bool

type Tun

type Tun struct {
	*Base
	// contains filtered or unexported fields
}

func NewTun

func NewTun(options *TunOption) (*Tun, error)

func (*Tun) Address

func (t *Tun) Address() string

Address implements constant.InboundListener

func (*Tun) Close

func (t *Tun) Close() error

Close implements constant.InboundListener

func (*Tun) Config

func (t *Tun) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Tun) Listen

func (t *Tun) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type TunOption

type TunOption struct {
	BaseOption
	Device              string   `inbound:"device,omitempty"`
	Stack               string   `inbound:"stack,omitempty"`
	DNSHijack           []string `inbound:"dns-hijack,omitempty"`
	AutoRoute           bool     `inbound:"auto-route,omitempty"`
	AutoDetectInterface bool     `inbound:"auto-detect-interface,omitempty"`

	MTU                    uint32   `inbound:"mtu,omitempty"`
	GSO                    bool     `inbound:"gso,omitempty"`
	GSOMaxSize             uint32   `inbound:"gso-max-size,omitempty"`
	Inet4Address           []string `inbound:"inet4-address,omitempty"`
	Inet6Address           []string `inbound:"inet6-address,omitempty"`
	IPRoute2TableIndex     int      `inbound:"iproute2-table-index"`
	IPRoute2RuleIndex      int      `inbound:"iproute2-rule-index"`
	AutoRedirect           bool     `inbound:"auto-redirect"`
	AutoRedirectInputMark  uint32   `inbound:"auto-redirect-input-mark"`
	AutoRedirectOutputMark uint32   `inbound:"auto-redirect-output-mark"`
	StrictRoute            bool     `inbound:"strict-route,omitempty"`
	RouteAddress           []string `inbound:"route-address"`
	RouteAddressSet        []string `inbound:"route-address-set"`
	RouteExcludeAddress    []string `inbound:"route-exclude-address"`
	RouteExcludeAddressSet []string `inbound:"route-exclude-address-set"`
	IncludeInterface       []string `inbound:"include-interface,omitempty"`
	ExcludeInterface       []string `inbound:"exclude-interface"`
	IncludeUID             []uint32 `inbound:"include-uid,omitempty"`
	IncludeUIDRange        []string `inbound:"include-uid-range,omitempty"`
	ExcludeUID             []uint32 `inbound:"exclude-uid,omitempty"`
	ExcludeUIDRange        []string `inbound:"exclude-uid-range,omitempty"`
	IncludeAndroidUser     []int    `inbound:"include-android-user,omitempty"`
	IncludePackage         []string `inbound:"include-package,omitempty"`
	ExcludePackage         []string `inbound:"exclude-package,omitempty"`
	EndpointIndependentNat bool     `inbound:"endpoint-independent-nat,omitempty"`
	UDPTimeout             int64    `inbound:"udp-timeout,omitempty"`
	FileDescriptor         int      `inbound:"file-descriptor,omitempty"`

	Inet4RouteAddress        []string `inbound:"inet4-route-address,omitempty"`
	Inet6RouteAddress        []string `inbound:"inet6-route-address,omitempty"`
	Inet4RouteExcludeAddress []string `inbound:"inet4-route-exclude-address,omitempty"`
	Inet6RouteExcludeAddress []string `inbound:"inet6-route-exclude-address,omitempty"`
}

func (TunOption) Equal

func (o TunOption) Equal(config C.InboundConfig) bool

type Tunnel

type Tunnel struct {
	*Base
	// contains filtered or unexported fields
}

func NewTunnel

func NewTunnel(options *TunnelOption) (*Tunnel, error)

func (*Tunnel) Address

func (t *Tunnel) Address() string

Address implements constant.InboundListener

func (*Tunnel) Close

func (t *Tunnel) Close() error

Close implements constant.InboundListener

func (*Tunnel) Config

func (t *Tunnel) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Tunnel) Listen

func (t *Tunnel) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type TunnelOption

type TunnelOption struct {
	BaseOption
	Network []string `inbound:"network"`
	Target  string   `inbound:"target"`
}

func (TunnelOption) Equal

func (o TunnelOption) Equal(config C.InboundConfig) bool

type Vmess

type Vmess struct {
	*Base
	// contains filtered or unexported fields
}

func NewVmess

func NewVmess(options *VmessOption) (*Vmess, error)

func (*Vmess) Address

func (v *Vmess) Address() string

Address implements constant.InboundListener

func (*Vmess) Close

func (v *Vmess) Close() error

Close implements constant.InboundListener

func (*Vmess) Config

func (v *Vmess) Config() C.InboundConfig

Config implements constant.InboundListener

func (*Vmess) Listen

func (v *Vmess) Listen(tunnel C.Tunnel) error

Listen implements constant.InboundListener

type VmessOption

type VmessOption struct {
	BaseOption
	Users       []VmessUser `inbound:"users"`
	WsPath      string      `inbound:"ws-path,omitempty"`
	Certificate string      `inbound:"certificate,omitempty"`
	PrivateKey  string      `inbound:"private-key,omitempty"`
	MuxOption   MuxOption   `inbound:"mux-option,omitempty"`
}

func (VmessOption) Equal

func (o VmessOption) Equal(config C.InboundConfig) bool

type VmessUser

type VmessUser struct {
	Username string `inbound:"username,omitempty"`
	UUID     string `inbound:"uuid"`
	AlterID  int    `inbound:"alterId"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL