proxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UDPBufSize = 4096
View Source
var UDPReadTimeout = time.Second * 30

Functions

This section is empty.

Types

type Config

type Config struct {
	Name       string
	ProxyType  string `ini:"type"`
	RemoteIp   string `ini:"remote_ip"`
	RemotePort string `ini:"remote_port"`
	LocalIp    string `ini:"local_ip"`
	LocalPort  string `ini:"local_port"`
}

type Proxy

type Proxy interface {
	Run()
	Close()
	LocalAddr() string
	RemoteAddr() string
	Name() string
}

type TCPProxy

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

func NewTCPProxy

func NewTCPProxy(cfg *Config, conn net.Conn) (*TCPProxy, error)

func (*TCPProxy) Close

func (self *TCPProxy) Close()

func (*TCPProxy) LocalAddr

func (self *TCPProxy) LocalAddr() string

func (*TCPProxy) Name

func (self *TCPProxy) Name() string

func (*TCPProxy) RemoteAddr

func (self *TCPProxy) RemoteAddr() string

func (*TCPProxy) Run

func (self *TCPProxy) Run()

func (*TCPProxy) String

func (self *TCPProxy) String() string

type UDPProxy

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

func NewUDPProxy

func NewUDPProxy(cfg *Config, conn net.Conn) (*UDPProxy, error)

func (*UDPProxy) Close

func (self *UDPProxy) Close()

func (*UDPProxy) LocalAddr

func (self *UDPProxy) LocalAddr() string

func (*UDPProxy) Name

func (self *UDPProxy) Name() string

func (*UDPProxy) RemoteAddr

func (self *UDPProxy) RemoteAddr() string

func (*UDPProxy) Run

func (self *UDPProxy) Run()

func (*UDPProxy) String

func (self *UDPProxy) String() string

Jump to

Keyboard shortcuts

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