listener

package
v0.3.1-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TunEndpointDriver_name = map[int32]string{
		0: "fdbased",
		1: "channel",
		2: "system_gvisor",
	}
	TunEndpointDriver_value = map[string]int32{
		"fdbased":       0,
		"channel":       1,
		"system_gvisor": 2,
	}
)

Enum value maps for TunEndpointDriver.

View Source
var File_config_listener_listener_proto protoreflect.FileDescriptor

Functions

func CreateServer

func CreateServer(opts *Opts[IsProtocol_Protocol]) (server.Server, error)

func RegisterProtocol

func RegisterProtocol[T isProtocol_Protocol](wrap func(*Opts[T]) (server.Server, error))

Types

type Config

type Config struct {
	Servers map[string]*Protocol `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetServers

func (x *Config) GetServers() map[string]*Protocol

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Http

type Http struct {
	Host     string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*Http) Descriptor deprecated

func (*Http) Descriptor() ([]byte, []int)

Deprecated: Use Http.ProtoReflect.Descriptor instead.

func (*Http) GetHost

func (x *Http) GetHost() string

func (*Http) GetPassword

func (x *Http) GetPassword() string

func (*Http) GetUsername

func (x *Http) GetUsername() string

func (*Http) ProtoMessage

func (*Http) ProtoMessage()

func (*Http) ProtoReflect

func (x *Http) ProtoReflect() protoreflect.Message

func (*Http) Reset

func (x *Http) Reset()

func (*Http) String

func (x *Http) String() string

type IsProtocol_Protocol

type IsProtocol_Protocol interface {
	// contains filtered or unexported methods
}

type Opts

type Opts[T isProtocol_Protocol] struct {
	Dialer    proxy.Proxy
	DNSServer server.DNSServer
	IPv6      bool

	Protocol T
}

func CovertOpts

func CovertOpts[T1, T2 isProtocol_Protocol](o *Opts[T1], f func(t T1) T2) *Opts[T2]

type ProcessDumper

type ProcessDumper interface {
	ProcessName(network string, src, dst proxy.Address) (string, error)
}

type Protocol

type Protocol struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Enabled bool   `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// Types that are assignable to Protocol:
	//
	//	*Protocol_Http
	//	*Protocol_Socks5
	//	*Protocol_Redir
	//	*Protocol_Tun
	Protocol isProtocol_Protocol `protobuf_oneof:"protocol"`
	// contains filtered or unexported fields
}

func (*Protocol) Descriptor deprecated

func (*Protocol) Descriptor() ([]byte, []int)

Deprecated: Use Protocol.ProtoReflect.Descriptor instead.

func (*Protocol) GetEnabled

func (x *Protocol) GetEnabled() bool

func (*Protocol) GetHttp

func (x *Protocol) GetHttp() *Http

func (*Protocol) GetName

func (x *Protocol) GetName() string

func (*Protocol) GetProtocol

func (m *Protocol) GetProtocol() isProtocol_Protocol

func (*Protocol) GetRedir

func (x *Protocol) GetRedir() *Redir

func (*Protocol) GetSocks5

func (x *Protocol) GetSocks5() *Socks5

func (*Protocol) GetTun

func (x *Protocol) GetTun() *Tun

func (*Protocol) ProtoMessage

func (*Protocol) ProtoMessage()

func (*Protocol) ProtoReflect

func (x *Protocol) ProtoReflect() protoreflect.Message

func (*Protocol) Reset

func (x *Protocol) Reset()

func (*Protocol) String

func (x *Protocol) String() string

type Protocol_Http

type Protocol_Http struct {
	Http *Http `protobuf:"bytes,3,opt,name=http,proto3,oneof"`
}

type Protocol_Redir

type Protocol_Redir struct {
	Redir *Redir `protobuf:"bytes,5,opt,name=redir,proto3,oneof"`
}

type Protocol_Socks5

type Protocol_Socks5 struct {
	Socks5 *Socks5 `protobuf:"bytes,4,opt,name=socks5,proto3,oneof"`
}

type Protocol_Tun

type Protocol_Tun struct {
	Tun *Tun `protobuf:"bytes,6,opt,name=tun,proto3,oneof"`
}

type Redir

type Redir struct {
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// contains filtered or unexported fields
}

func (*Redir) Descriptor deprecated

func (*Redir) Descriptor() ([]byte, []int)

Deprecated: Use Redir.ProtoReflect.Descriptor instead.

func (*Redir) GetHost

func (x *Redir) GetHost() string

func (*Redir) ProtoMessage

func (*Redir) ProtoMessage()

func (*Redir) ProtoReflect

func (x *Redir) ProtoReflect() protoreflect.Message

func (*Redir) Reset

func (x *Redir) Reset()

func (*Redir) String

func (x *Redir) String() string

type Socks5

type Socks5 struct {
	Host     string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

func (*Socks5) Descriptor deprecated

func (*Socks5) Descriptor() ([]byte, []int)

Deprecated: Use Socks5.ProtoReflect.Descriptor instead.

func (*Socks5) GetHost

func (x *Socks5) GetHost() string

func (*Socks5) GetPassword

func (x *Socks5) GetPassword() string

func (*Socks5) GetUsername

func (x *Socks5) GetUsername() string

func (*Socks5) ProtoMessage

func (*Socks5) ProtoMessage()

func (*Socks5) ProtoReflect

func (x *Socks5) ProtoReflect() protoreflect.Message

func (*Socks5) Reset

func (x *Socks5) Reset()

func (*Socks5) String

func (x *Socks5) String() string

type Tun

type Tun struct {

	// name of the tun device
	// eg: tun://tun0, fd://123
	Name          string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Mtu           int32             `protobuf:"varint,2,opt,name=mtu,proto3" json:"mtu,omitempty"`
	Gateway       string            `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	DnsHijacking  bool              `protobuf:"varint,4,opt,name=dns_hijacking,proto3" json:"dns_hijacking,omitempty"`
	SkipMulticast bool              `protobuf:"varint,6,opt,name=skip_multicast,proto3" json:"skip_multicast,omitempty"`
	Driver        TunEndpointDriver `protobuf:"varint,7,opt,name=driver,proto3,enum=yuhaiin.listener.TunEndpointDriver" json:"driver,omitempty"`
	Portal        string            `protobuf:"bytes,8,opt,name=portal,proto3" json:"portal,omitempty"`
	// contains filtered or unexported fields
}

func (*Tun) Descriptor deprecated

func (*Tun) Descriptor() ([]byte, []int)

Deprecated: Use Tun.ProtoReflect.Descriptor instead.

func (*Tun) GetDnsHijacking

func (x *Tun) GetDnsHijacking() bool

func (*Tun) GetDriver

func (x *Tun) GetDriver() TunEndpointDriver

func (*Tun) GetGateway

func (x *Tun) GetGateway() string

func (*Tun) GetMtu

func (x *Tun) GetMtu() int32

func (*Tun) GetName

func (x *Tun) GetName() string

func (*Tun) GetPortal

func (x *Tun) GetPortal() string

func (*Tun) GetSkipMulticast

func (x *Tun) GetSkipMulticast() bool

func (*Tun) ProtoMessage

func (*Tun) ProtoMessage()

func (*Tun) ProtoReflect

func (x *Tun) ProtoReflect() protoreflect.Message

func (*Tun) Reset

func (x *Tun) Reset()

func (*Tun) String

func (x *Tun) String() string

type TunEndpointDriver

type TunEndpointDriver int32
const (
	Tun_fdbased       TunEndpointDriver = 0
	Tun_channel       TunEndpointDriver = 1
	Tun_system_gvisor TunEndpointDriver = 2
)

func (TunEndpointDriver) Descriptor

func (TunEndpointDriver) Enum

func (TunEndpointDriver) EnumDescriptor deprecated

func (TunEndpointDriver) EnumDescriptor() ([]byte, []int)

Deprecated: Use TunEndpointDriver.Descriptor instead.

func (TunEndpointDriver) Number

func (TunEndpointDriver) String

func (x TunEndpointDriver) String() string

func (TunEndpointDriver) Type

Jump to

Keyboard shortcuts

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