Documentation ¶
Index ¶
- Constants
- Variables
- type Conn
- type ContextDialer
- type ContextDialerConverter
- type Dialer
- type FakeNetConn
- type FakeNetPacketConn
- func (conn *FakeNetPacketConn) LocalAddr() net.Addr
- func (conn *FakeNetPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (conn *FakeNetPacketConn) ReadMsgUDP(b []byte, oob []byte) (n int, oobn int, flags int, addr *net.UDPAddr, err error)
- func (conn *FakeNetPacketConn) RemoteAddr() net.Addr
- func (conn *FakeNetPacketConn) SetReadBuffer(size int) error
- func (conn *FakeNetPacketConn) SetWriteBuffer(size int) error
- func (conn *FakeNetPacketConn) SyscallConn() (syscall.RawConn, error)
- func (conn *FakeNetPacketConn) WriteMsgUDP(b []byte, oob []byte, addr *net.UDPAddr) (n int, oobn int, err error)
- func (conn *FakeNetPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
- type FullConn
- type MagicNetwork
- type PacketConn
Constants ¶
View Source
const MagicNetworkType = 0
Variables ¶
View Source
var SoMark = func(fd int, mark int) error { if err := syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, fwmarkIoctl, mark); err != nil { return err } return nil }
SoMark is replacable. Replacibility is useful for Android.
View Source
var SoMarkControl = func(c syscall.RawConn, mark int) error { var sockOptErr error controlErr := c.Control(func(fd uintptr) { err := unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, fwmarkIoctl, mark) if err != nil { sockOptErr = fmt.Errorf("error setting SO_MARK socket option: %w", err) } }) if controlErr != nil { return fmt.Errorf("error invoking socket control function: %w", controlErr) } return sockOptErr }
SoMarkControl is replacable. Replacibility is useful for Android.
View Source
var (
UnknownMagicNetworkEncodingError = fmt.Errorf("unknown magic network encoding")
)
View Source
var UnsupportedTunnelTypeError = net.UnknownNetworkError("unsupported tunnel type")
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type ContextDialer ¶
type ContextDialerConverter ¶
type ContextDialerConverter struct {
Dialer
}
func (*ContextDialerConverter) DialContext ¶
type Dialer ¶
A Dialer is a means to establish a connection. Custom dialers should also implement ContextDialer.
type FakeNetConn ¶
func (*FakeNetConn) LocalAddr ¶
func (conn *FakeNetConn) LocalAddr() net.Addr
func (*FakeNetConn) RemoteAddr ¶
func (conn *FakeNetConn) RemoteAddr() net.Addr
type FakeNetPacketConn ¶
type FakeNetPacketConn struct { PacketConn LAddr net.Addr RAddr net.Addr }
func (*FakeNetPacketConn) LocalAddr ¶
func (conn *FakeNetPacketConn) LocalAddr() net.Addr
func (*FakeNetPacketConn) ReadMsgUDP ¶
func (conn *FakeNetPacketConn) ReadMsgUDP(b []byte, oob []byte) (n int, oobn int, flags int, addr *net.UDPAddr, err error)
ReadMsgUDP implements quic.OOBCapablePacketConn.
func (*FakeNetPacketConn) RemoteAddr ¶
func (conn *FakeNetPacketConn) RemoteAddr() net.Addr
func (*FakeNetPacketConn) SetReadBuffer ¶
func (conn *FakeNetPacketConn) SetReadBuffer(size int) error
func (*FakeNetPacketConn) SetWriteBuffer ¶
func (conn *FakeNetPacketConn) SetWriteBuffer(size int) error
func (*FakeNetPacketConn) SyscallConn ¶
func (conn *FakeNetPacketConn) SyscallConn() (syscall.RawConn, error)
func (*FakeNetPacketConn) WriteMsgUDP ¶
func (conn *FakeNetPacketConn) WriteMsgUDP(b []byte, oob []byte, addr *net.UDPAddr) (n int, oobn int, err error)
WriteMsgUDP implements quic.OOBCapablePacketConn.
type FullConn ¶
type FullConn interface { Conn PacketConn }
type MagicNetwork ¶
func ParseMagicNetwork ¶
func ParseMagicNetwork(network string) (mn *MagicNetwork, err error)
func (MagicNetwork) Encode ¶
func (mn MagicNetwork) Encode() string
type PacketConn ¶
type PacketConn interface { Read(b []byte) (n int, err error) Write(b []byte) (n int, err error) ReadFrom(p []byte) (n int, addr netip.AddrPort, err error) WriteTo(p []byte, addr string) (n int, err error) Close() error SetDeadline(t time.Time) error SetReadDeadline(t time.Time) error SetWriteDeadline(t time.Time) error }
Click to show internal directories.
Click to hide internal directories.