Documentation ¶
Index ¶
- Variables
- func DialToDest(src v2net.Address, dest v2net.Destination) (net.Conn, error)
- func SubstituteDialer(dialer SystemDialerAdapter) error
- func UseAlternativeSystemDialer(dialer SystemDialer)
- 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 ¶
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 ¶ added in v1.21.2
func UseAlternativeSystemDialer(dialer SystemDialer)
UseAlternativeSystemDialer replaces the current system dialer with a given one. Caller must ensure there is no race condition.
Types ¶
type Connection ¶
func Dial ¶
func Dial(src v2net.Address, dest v2net.Destination, settings *StreamSettings) (Connection, error)
type ConnectionHandler ¶
type ConnectionHandler func(Connection)
type DefaultSystemDialer ¶ added in v1.21.2
type DefaultSystemDialer struct { }
func (*DefaultSystemDialer) Dial ¶ added in v1.21.2
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 )
type Listener ¶
type Listener interface { Accept() (Connection, error) Close() error Addr() net.Addr }
type SimpleSystemDialer ¶ added in v1.21.2
type SimpleSystemDialer struct {
// contains filtered or unexported fields
}
func (*SimpleSystemDialer) Dial ¶ added in v1.21.2
func (this *SimpleSystemDialer) Dial(src v2net.Address, dest v2net.Destination) (net.Conn, error)
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 SystemDialer ¶ added in v1.21.2
type SystemDialer interface {
Dial(source v2net.Address, destination v2net.Destination) (net.Conn, error)
}
func WithAdapter ¶ added in v1.21.2
func WithAdapter(dialer SystemDialerAdapter) SystemDialer
type SystemDialerAdapter ¶ added in v1.21.2
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
Directories ¶
Path | Synopsis |
---|---|
Package kcp - A Fast and Reliable ARQ Protocol Acknowledgement: skywind3000@github for inventing the KCP protocol xtaci@github for translating to Golang
|
Package kcp - A Fast and Reliable ARQ Protocol Acknowledgement: skywind3000@github for inventing the KCP protocol xtaci@github for translating to Golang |
Click to show internal directories.
Click to hide internal directories.