Documentation ¶
Index ¶
- Variables
- func DialToDest(src v2net.Address, dest v2net.Destination) (net.Conn, error)
- func RegisterAuthenticator(name string, factory AuthenticatorFactory, configCreator loader.ConfigCreator) error
- func SubstituteDialer(dialer SystemDialerAdapter) error
- func UseAlternativeSystemDialer(dialer SystemDialer)
- type Authenticator
- type AuthenticatorChain
- type AuthenticatorConfig
- type AuthenticatorFactory
- type Connection
- type ConnectionHandler
- type DefaultSystemDialer
- type Dialer
- type ListenFunc
- type Listener
- type Reusable
- type SimpleSystemDialer
- type StreamConnectionType
- type StreamSecurityType
- type StreamSettings
- type SysFd
- type SystemDialer
- type SystemDialerAdapter
- type TCPHub
- type TLSSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedStreamType = errors.New("Unsupported stream type.")
)
Functions ¶
func DialToDest ¶ added in v1.17.1
func RegisterAuthenticator ¶ added in v1.23.1
func RegisterAuthenticator(name string, factory AuthenticatorFactory, configCreator loader.ConfigCreator) error
func SubstituteDialer ¶ added in v1.21.2
func SubstituteDialer(dialer SystemDialerAdapter) error
SubstituteDialer replaces the current system dialer with a given one. Caller must ensure there is no race condition. @Deprecated: Use UseAlternativeSimpleSystemDialer.
func UseAlternativeSystemDialer ¶
func UseAlternativeSystemDialer(dialer SystemDialer)
UseAlternativeSystemDialer replaces the current system dialer with a given one. Caller must ensure there is no race condition.
Types ¶
type Authenticator ¶ added in v1.23.1
func CreateAuthenticator ¶ added in v1.23.1
func CreateAuthenticator(name string, config AuthenticatorConfig) (Authenticator, error)
func NewAuthenticatorChain ¶ added in v1.23.1
func NewAuthenticatorChain(auths ...Authenticator) Authenticator
type AuthenticatorChain ¶ added in v1.23.1
type AuthenticatorChain struct {
// contains filtered or unexported fields
}
func (*AuthenticatorChain) Open ¶ added in v1.23.1
func (this *AuthenticatorChain) Open(payload *alloc.Buffer) bool
func (*AuthenticatorChain) Overhead ¶ added in v1.23.1
func (this *AuthenticatorChain) Overhead() int
func (*AuthenticatorChain) Seal ¶ added in v1.23.1
func (this *AuthenticatorChain) Seal(payload *alloc.Buffer)
type AuthenticatorConfig ¶ added in v1.23.1
type AuthenticatorConfig interface { }
func CreateAuthenticatorConfig ¶ added in v1.23.1
func CreateAuthenticatorConfig(rawConfig []byte) (string, AuthenticatorConfig, error)
type AuthenticatorFactory ¶ added in v1.23.1
type AuthenticatorFactory interface {
Create(AuthenticatorConfig) Authenticator
}
type Connection ¶
func Dial ¶
func Dial(src v2net.Address, dest v2net.Destination, settings *StreamSettings) (Connection, error)
type ConnectionHandler ¶ added in v1.17.1
type ConnectionHandler func(Connection)
type DefaultSystemDialer ¶
type DefaultSystemDialer struct { }
func (*DefaultSystemDialer) Dial ¶
func (this *DefaultSystemDialer) Dial(src v2net.Address, dest v2net.Destination) (net.Conn, error)
type Dialer ¶
type Dialer func(src v2net.Address, dest v2net.Destination) (Connection, error)
type ListenFunc ¶
var ( ErrClosedConnection = errors.New("Connection already closed.") KCPListenFunc ListenFunc TCPListenFunc ListenFunc RawTCPListenFunc ListenFunc WSListenFunc ListenFunc )
type Listener ¶
type Listener interface { Accept() (Connection, error) Close() error Addr() net.Addr }
type SimpleSystemDialer ¶
type SimpleSystemDialer struct {
// contains filtered or unexported fields
}
func (*SimpleSystemDialer) Dial ¶
func (this *SimpleSystemDialer) Dial(src v2net.Address, dest v2net.Destination) (net.Conn, error)
type StreamConnectionType ¶ added in v1.17.1
type StreamConnectionType int
const ( StreamConnectionTypeRawTCP StreamConnectionType = 1 StreamConnectionTypeTCP StreamConnectionType = 2 StreamConnectionTypeKCP StreamConnectionType = 4 StreamConnectionTypeWebSocket StreamConnectionType = 8 )
type StreamSecurityType ¶ added in v1.19.1
type StreamSecurityType int
const ( StreamSecurityTypeNone StreamSecurityType = 0 StreamSecurityTypeTLS StreamSecurityType = 1 )
type StreamSettings ¶ added in v1.17.1
type StreamSettings struct { Type StreamConnectionType Security StreamSecurityType TLSSettings *TLSSettings }
func (*StreamSettings) IsCapableOf ¶ added in v1.17.1
func (this *StreamSettings) IsCapableOf(streamType StreamConnectionType) bool
type SystemDialer ¶
type SystemDialer interface {
Dial(source v2net.Address, destination v2net.Destination) (net.Conn, error)
}
func WithAdapter ¶
func WithAdapter(dialer SystemDialerAdapter) SystemDialer
type SystemDialerAdapter ¶
type TCPHub ¶ added in v1.17.1
func ListenTCP ¶
func ListenTCP(address v2net.Address, port v2net.Port, callback ConnectionHandler, settings *StreamSettings) (*TCPHub, error)
type TLSSettings ¶ added in v1.19.1
type TLSSettings struct { AllowInsecure bool Certs []tls.Certificate }
func (*TLSSettings) GetTLSConfig ¶ added in v1.19.1
func (this *TLSSettings) GetTLSConfig() *tls.Config
Source Files ¶
Click to show internal directories.
Click to hide internal directories.