constant

package
v0.0.0-...-5f892d9 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP NetWork = iota
	UDP

	HTTP Type = iota
	HTTPCONNECT
	SOCKS
	REDIR
	TPROXY
	TEST
)

Socks addr type

View Source
const (
	DefaultTLSTimeout = 5 * time.Second
)

Variables

View Source
var (
	Version   = "v0.15.0"
	BuildTime = "unknown time"
)

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	NetWork NetWork `json:"network"` // tcp =3 udp = 4
	Type    Type    `json:"type"`
	SrcIP   net.IP  `json:"sourceIP"`
	DstIP   net.IP  `json:"destinationIP"`
	SrcPort string  `json:"sourcePort"`
	DstPort string  `json:"destinationPort"`
	Host    string  `json:"host"`
	Timeout time.Duration
}

Metadata is used to store connection address

func (*Metadata) AddrType

func (m *Metadata) AddrType() int

IPv4=1 DomainName=3 IPv6=4

func (*Metadata) RemoteAddress

func (m *Metadata) RemoteAddress() string

func (*Metadata) Resolved

func (m *Metadata) Resolved() bool

func (*Metadata) SourceAddress

func (m *Metadata) SourceAddress() string

func (*Metadata) String

func (m *Metadata) String() string

func (*Metadata) UDPAddr

func (m *Metadata) UDPAddr() *net.UDPAddr

func (*Metadata) Valid

func (m *Metadata) Valid() bool

type NetWork

type NetWork int

func (NetWork) MarshalJSON

func (n NetWork) MarshalJSON() ([]byte, error)

func (NetWork) String

func (n NetWork) String() string

type Type

type Type int

func (Type) MarshalJSON

func (t Type) MarshalJSON() ([]byte, error)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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