Documentation ¶
Index ¶
- Constants
- Variables
- func DialContext(ctx context.Context, network, address string, options ...Option) (net.Conn, error)
- func GetIP4PEnable(enableIP4PConvert bool)
- func GetTcpConcurrent() bool
- func ListenPacket(ctx context.Context, network, address string, rAddrPort netip.AddrPort, ...) (net.PacketConn, error)
- func LookupLocalAddrFromIfaceName(ifaceName string, network string, destination netip.Addr, port int) (net.Addr, error)
- func ParseNetwork(network string, addr netip.Addr) string
- func SetTcpConcurrent(concurrent bool)
- type Dialer
- type NetDialer
- type Option
- func WithAddrReuse(reuse bool) Option
- func WithFallbackBind(fallback bool) Option
- func WithInterface(name string) Option
- func WithMPTCP(mpTcp bool) Option
- func WithNetDialer(netDialer NetDialer) Option
- func WithOnlySingleStack(isIPv4 bool) Option
- func WithOption(o option) Option
- func WithPreferIPv4() Option
- func WithPreferIPv6() Option
- func WithResolver(r resolver.Resolver) Option
- func WithRoutingMark(mark int) Option
- func WithTFO(tfo bool) Option
- type SocketControl
Constants ¶
View Source
const ( DefaultTCPTimeout = 5 * time.Second DefaultUDPTimeout = DefaultTCPTimeout )
View Source
const DisableTFO = false
Variables ¶
View Source
var ( ErrorNoIpAddress = errors.New("no ip address") ErrorInvalidedNetworkStack = errors.New("invalided network stack") )
View Source
var ( DefaultOptions []Option DefaultInterface = atomic.NewTypedValue[string]("") DefaultRoutingMark = atomic.NewInt32(0) )
View Source
var (
IP4PEnable bool
)
Functions ¶
func DialContext ¶
func GetIP4PEnable ¶
func GetIP4PEnable(enableIP4PConvert bool)
func GetTcpConcurrent ¶
func GetTcpConcurrent() bool
func ListenPacket ¶
func SetTcpConcurrent ¶
func SetTcpConcurrent(concurrent bool)
Types ¶
type Option ¶
type Option func(opt *option)
func WithAddrReuse ¶
func WithFallbackBind ¶
func WithInterface ¶
func WithNetDialer ¶
func WithOnlySingleStack ¶
func WithOption ¶
func WithOption(o option) Option
func WithPreferIPv4 ¶
func WithPreferIPv4() Option
func WithPreferIPv6 ¶
func WithPreferIPv6() Option
func WithResolver ¶
func WithRoutingMark ¶
type SocketControl ¶
var DefaultSocketHook SocketControl
Click to show internal directories.
Click to hide internal directories.