Documentation
¶
Index ¶
- func SetLogger(newLogger zerolog.Logger)
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- 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 (c *Conn) Write(b []byte) (int, error)
- type ListenConfig
- type Listener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func DialContext ¶
func DialContext(dialCtx context.Context, address string, tlsConfig *tls.Config, ordered bool, iceServers []string) (*Conn, error)
Dials until the data channel opens or dialCtx is done. The context only bounds the dial, the returned connection outlives it
func (*Conn) RemoteAddr ¶
type ListenConfig ¶
type ListenConfig struct {
TlsConfig *tls.Config
OriginPatterns []string
// Note: STUN lookups run on ephemeral ports rather than the listen port, so their candidates are unreachable when only the listen port is open. Prefer PublicIP
IceServers []string
// The IPv4 address clients reach this listener at, advertised in place of the local interface addresses.
// Needed behind a 1:1 NAT, such as a docker bridge network or a cloud VM without its public IP on an interface
PublicIP string
// Run ICE-lite: the listener only answers connectivity checks rather than also sending its own, which is less work and traffic per connection.
// Only use it when clients can reach the listener directly at its advertised address, ie a public interface or PublicIP with the port forwarded. Lite only uses host candidates, so IceServers must be empty
IceLite bool
// Max connections that are negotiating or waiting to be accepted. Beyond this, new requests are rejected with a 503. Defaults to 256
MaxPendingConns int
}
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
func NewListener(address string, config ListenConfig) (*Listener, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.