utils

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOriginAllowed

func CheckOriginAllowed(remoteIP netip.Addr, allowedSubnets []netip.Prefix) bool

func DialUpstreamControl

func DialUpstreamControl(sport uint16, protocol Protocol, mark int) func(string, string, syscall.RawConn) error

func ParseHostPort

func ParseHostPort(hostport string, ipVersion int) (netip.AddrPort, error)

Types

type Options

type Options struct {
	Protocol           Protocol
	ListenAddr         netip.AddrPort
	TargetAddr4        netip.AddrPort
	TargetAddr6        netip.AddrPort
	DynamicDestination bool
	Mark               int
	Verbose            int
	AllowedSubnets     []netip.Prefix
	UDPCloseAfter      time.Duration
}

type Protocol

type Protocol int
const (
	TCP Protocol = iota
	UDP
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL