Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupError ¶
Types ¶
type Guard ¶
Guard is the network policy decision a dialer applies to the address the operating system is about to connect to. It is the last gate in front of connect: returning an error from it means no packet is sent.
type HostConn ¶
type HostConn struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(ctx context.Context, pc ratelimit.PacketCount, id uuid.UUID, conn net.Conn, opts HostConnOpts) (_ *HostConn, err error)
NewConnection consumes conn. On failure it closes the attached wrapper (if available), otherwise the original connection. On success HostConn owns it.
func (*HostConn) RemoteAddr ¶
func (*HostConn) Type ¶
func (h *HostConn) Type() socket.SocketType
type HostConnOpts ¶
type HostConnOpts struct {
ConnAddr string
MaximumBandwidth app.Bitrate
SocketType socket.SocketType
}
type HostDialer ¶
type HostDialer struct {
// contains filtered or unexported fields
}
HostDialer dials a guest's connection under a Guard. It holds no policy of its own: everything it refuses, it refuses because the guard did.
func NewDialer ¶
func NewDialer(guard Guard) (*HostDialer, error)
NewDialer returns a dialer that consults guard for every socket it opens.
func (*HostDialer) Control ¶
func (hd *HostDialer) Control(network, address string, _ syscall.RawConn) error
Control is the net.Dialer control hook. The operating system calls it with the resolved address after the socket exists and before it is connected, so a refusal here is a destination that was never contacted.