Documentation ¶
Overview ¶
Package quic wraps github.com/lucas-clemente/quic-go with net.Listener and net.Conn types that provide a drop-in replacement for net.TCPConn.
Each QUIC session has exactly one stream, which is the equivilent of a TCP stream.
Conns returned from Accept will have an established QUIC session and are configured to perform a deferred AcceptStream on the first Read or Write.
Conns returned from Dial have an established QUIC session and stream. Dial accepts a Context input which may be used to cancel the dial.
Conns mask or translate qerr.PeerGoingAway to io.EOF as appropriate.
QUIC idle timeouts and keep alives are tuned to mitigate aggressive UDP NAT timeouts on mobile data networks while accounting for the fact that mobile devices in standby/sleep may not be able to initiate the keep alive.
Index ¶
- Constants
- func Dial(ctx context.Context, packetConn net.PacketConn, remoteAddr *net.UDPAddr, ...) (net.Conn, error)
- type Conn
- func (conn *Conn) Close() error
- func (conn *Conn) IsClosed() bool
- func (conn *Conn) LocalAddr() net.Addr
- func (conn *Conn) Read(b []byte) (int, error)
- func (conn *Conn) RemoteAddr() net.Addr
- func (conn *Conn) SetDeadline(t time.Time) error
- func (conn *Conn) SetReadDeadline(t time.Time) error
- func (conn *Conn) SetWriteDeadline(t time.Time) error
- func (conn *Conn) Write(b []byte) (int, error)
- type Listener
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial( ctx context.Context, packetConn net.PacketConn, remoteAddr *net.UDPAddr, quicSNIAddress string) (net.Conn, error)
Dial establishes a new QUIC session and stream to the server specified by address.
packetConn is used as the underlying packet connection for QUIC. The dial may be cancelled by ctx; packetConn will be closed if the dial is cancelled or fails.
Keep alive and idle timeout functionality in QUIC is disabled as these aspects are expected to be handled at a higher level.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a net.Conn and psiphon/common.Closer.
func (*Conn) RemoteAddr ¶
type Listener ¶
Listener is a net.Listener.