proxy

package
v0.0.0-...-250839a Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const UDP_DEFAULT_GC_INTERVAL = 10
View Source
const UDP_DEFAULT_GC_TIMEOUT = 30

Variables

View Source
var ErrNetClosing = errors.New("use of closed network connection")

Functions

func IsPort

func IsPort(str string) (result bool)

func IsSrcIP

func IsSrcIP(str string) (result bool)

Types

type Config

type Config struct {
	Protocol string
	FromAddr string
	ToAddr   string
}

定义配置参数

type Proxies

type Proxies struct {
	// contains filtered or unexported fields
}

func (*Proxies) Add

func (p *Proxies) Add(src, dst, protocol string) error

func (*Proxies) StartAll

func (p *Proxies) StartAll() (errs []error)

func (*Proxies) StopAll

func (p *Proxies) StopAll() (errs []error)

type Proxy

type Proxy interface {
	Start() error
	Stop() error
	IsConnected() bool
}

代理服务器接口

type ProxyInfo

type ProxyInfo struct {
	Src      string
	DstPort  string
	Protocol string
}

type ProxyManager

type ProxyManager interface {
	Add(src, dst, protocol string) error // add a new proxy
	StartAll() []error                   // start all proxy
	StopAll() []error                    // stop all proxy
}

func GetProxyManager

func GetProxyManager() ProxyManager

type TCP

type TCP struct {
	// contains filtered or unexported fields
}

定义TCP参数

func (*TCP) IsConnected

func (t *TCP) IsConnected() bool

func (*TCP) Start

func (t *TCP) Start() error

func (*TCP) Stop

func (t *TCP) Stop() error

type UDP

type UDP struct {
	// contains filtered or unexported fields
}

定义UDP参数

func (*UDP) IsConnected

func (t *UDP) IsConnected() bool

func (*UDP) Start

func (t *UDP) Start() error

func (*UDP) Stop

func (t *UDP) Stop() error

Jump to

Keyboard shortcuts

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