xnet

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendHostToXForwardHeader

func AppendHostToXForwardHeader(header netHttp.Header, host string)

func CopyHeader

func CopyHeader(dst, src netHttp.Header)

func DelHopHeaders

func DelHopHeaders(header netHttp.Header)

func Extract

func Extract(addr string) (string, error)

Extract returns a real ip

func GetAddrAndPort

func GetAddrAndPort() (string, int)

func GetHostAndPortByAddr

func GetHostAndPortByAddr(addr net.Addr) (string, uint64)

func GetPort

func GetPort() int

func GetQuery

func GetQuery(url string) string

func HasPort

func HasPort(s string) bool

Given a string of the form "host", "host:port", or "[ipv6::address]:port", return true if the string includes a port.

func IPs

func IPs() []string

IPs returns all known ips

func RemoveEmptyPort

func RemoveEmptyPort(host string) string

removeEmptyPort strips the empty port in ":port" to "" as mandated by RFC 3986 Section 6.2.3.

func SetCookie

func SetCookie(w netHttp.ResponseWriter, src []*netHttp.Cookie)

Types

This section is empty.

Jump to

Keyboard shortcuts

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