Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Connection ¶
func Dial ¶
func Dial(src v2net.Address, dest v2net.Destination, settings *StreamSettings) (Connection, error)
type ConnectionHandler ¶
type ConnectionHandler func(Connection)
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 )
type Listener ¶
type Listener interface { Accept() (Connection, error) Close() error Addr() net.Addr }
type StreamConnectionType ¶
type StreamConnectionType int
const ( StreamConnectionTypeRawTCP StreamConnectionType = 1 StreamConnectionTypeTCP StreamConnectionType = 2 StreamConnectionTypeKCP StreamConnectionType = 4 )
type StreamSecurityType ¶ added in v1.19.1
type StreamSecurityType int
const ( StreamSecurityTypeNone StreamSecurityType = 0 StreamSecurityTypeTLS StreamSecurityType = 1 )
type StreamSettings ¶
type StreamSettings struct { Type StreamConnectionType Security StreamSecurityType TLSSettings *TLSSettings }
func (*StreamSettings) IsCapableOf ¶
func (this *StreamSettings) IsCapableOf(streamType StreamConnectionType) bool
type TCPHub ¶
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
Click to show internal directories.
Click to hide internal directories.