Documentation ¶
Index ¶
- Constants
- Variables
- func Listen(ctx context.Context, network, address string, config *Config) (net.Listener, error)
- func ListenURL(ctx context.Context, listenURL *url.URL, config *Config) (net.Listener, error)
- func MayPerformXConnHandshake(Raw net.Conn) error
- func NewXDialerProtocol(UnderlyingDialer client.Protocol, XConfig *Config) client.Protocol
- type Config
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) ConsumeBuffer(ba *bufferio.BufferArray) error
- func (c *Conn) GetExtensionProperty() map[string]uint64
- func (c *Conn) Handshake() error
- func (c *Conn) IsClosed() bool
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) ProduceBuffer(bs *bufferio.BufferArray, startOffset int) error
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (*Conn) SupportBufferIO() bool
- func (c *Conn) SupportKeepAlive() bool
- func (c *Conn) Write(b []byte) (int, error)
- func (c *Conn) WriteTo(writer io.Writer) (int64, error)
Constants ¶
View Source
const (
PacketByteLimit = 1 << 25
)
Variables ¶
View Source
var (
EmbeddedPrivateKey = ""
)
Functions ¶
func Listen ¶
func ListenURL ¶
Types ¶
type Config ¶
type Config struct { AuthFunc func(string, ed25519.PublicKey) bool TraceFunc util.TracerFunc AuthPrivateKey ed25519.PrivateKey KeepaliveInterval time.Duration HandshakeTimeout time.Duration HandshakeServerAllowPublic bool // FECParityNum specifies the number of parity shards in every 16 packets. 0 means disabled. FECParityNum int // If enabled, a separate routine will do the actual IO. // This only affects the behavior of UDP connection. EnableAIO bool }
func ConstructXConfigFromEnv ¶
func ConstructXConfigFromEnv(maybeFec *int, maybePrivateKey, maybeKnownPeerPubKeys *string) (*Config, bool, error)
Return true if private key is generated at runtime. `maybeFec`, `maybePrivateKey` and `maybeKnownPeerPubKeys` can be nil.
func (*Config) GeneratePrivateKeyIfNotExists ¶ added in v0.2.42
Click to show internal directories.
Click to hide internal directories.