vpn_tcp

package
v0.0.0-...-8c25edb Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeHttp = iota
	TypeHttp2
	TypeUnknown
)

Variables

View Source
var BufferSize = 64 * 1024

Functions

func GetDefaultHttpResponse

func GetDefaultHttpResponse() []byte

GetDefaultHttpResponse returns the default http response

func GetDstKey

func GetDstKey(packet []byte) string

GetdstKey returns the destination key of the packets

func GetIPv4Dst

func GetIPv4Dst(packet []byte) net.IP

GEtIPv4Dst returns the IPv4 destination address of the packet

func GetIPv4Src

func GetIPv4Src(packet []byte) net.IP

GetIPv4Src returns the IPv4 source address of the packet

func GetIPv6Dst

func GetIPv6Dst(packet []byte) net.IP

GetIPv6Dst returns the IPv6 destination address of the packet

func GetIPv6Src

func GetIPv6Src(packet []byte) net.IP

GetIPv6Src returns the IPv6 source address of the packet

func GetSrcKey

func GetSrcKey(packet []byte) string

GetSrcKey returns the source key of the packet

func IsIPv4

func IsIPv4(packet []byte) bool

IsIPv4 returns true if the packet is IPv4s

func IsIPv6

func IsIPv6(packet []byte) bool

IsIPv6 returns true if the packet is IPv6s

func ServerStart

func ServerStart(config *Config) (err error)

Types

type Config

type Config struct {
	Address                string // 服务 监听地址
	CertificateFilePath    string // 证书
	CertificateKeyFilePath string // 证书Key
	Compress               bool   // 压缩
}

type SniffConn

type SniffConn struct {
	net.Conn

	Type int
	// contains filtered or unexported fields
}

func NewPeekPreDataConn

func NewPeekPreDataConn(c net.Conn) *SniffConn

func (*SniffConn) GetPath

func (c *SniffConn) GetPath() string

func (*SniffConn) Handle

func (c *SniffConn) Handle() bool

func (*SniffConn) Read

func (c *SniffConn) Read(p []byte) (int, error)

func (*SniffConn) SetPath

func (c *SniffConn) SetPath(path string)

Jump to

Keyboard shortcuts

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