src

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperateDefault = 0
	OperateEncode  = 1
	OperateDecode  = 2
)

Variables

View Source
var Coder = Code{
	// contains filtered or unexported fields
}

Functions

func Decode

func Decode(data []byte)

func DoRequestAndReturn

func DoRequestAndReturn(clientConn *TCPConn)

func Encode

func Encode(data []byte)

func HandlerSocks added in v1.0.4

func HandlerSocks(clientConn *net.TCPConn)

func StrToByte256

func StrToByte256(string2 string) [32]byte

Types

type Code

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

func (*Code) Decode

func (c *Code) Decode(b []byte)

func (*Code) Encode

func (c *Code) Encode(b []byte)

func (*Code) Init

func (c *Code) Init(passwd string)

type HttpProxy added in v1.0.4

type HttpProxy struct {
	*http.Request
	*http.Response
}

func (*HttpProxy) HandlerHttp added in v1.0.4

func (h *HttpProxy) HandlerHttp(clientConn *net.TCPConn)

func (*HttpProxy) Server added in v1.0.4

func (h *HttpProxy) Server()

type Proxy

type Proxy struct {
	Local      *net.TCPAddr
	Server     *net.TCPAddr
	LocalAddr  string `json:"local_addr"`
	LocalPort  int    `json:"local_port"`
	RemoteAddr string `json:"remote_addr"`
	RemotePort int    `json:"remote_port"`
	//Method string
	Password string `json:"password"`
	// contains filtered or unexported fields
}

func Init added in v1.0.4

func Init() Proxy

func (*Proxy) Decode

func (p *Proxy) Decode(data []byte)

func (*Proxy) Encode

func (p *Proxy) Encode(data []byte)

func (*Proxy) GeneratePwd

func (p *Proxy) GeneratePwd()

func (Proxy) GetLocalAddr

func (p Proxy) GetLocalAddr() string

func (Proxy) GetRemoteAddr

func (p Proxy) GetRemoteAddr() (*TCPConn, error)

func (Proxy) GetTargetAddr

func (p Proxy) GetTargetAddr(addr string) (*TCPConn, error)

func (Proxy) RemoteHandler

func (p Proxy) RemoteHandler(userConn *TCPConn)

type TCPConn

type TCPConn struct {
	io.ReadWriteCloser
	*Code
}

func GetTCPConn

func GetTCPConn(conn *net.TCPConn) *TCPConn

func (*TCPConn) CopyTo

func (from *TCPConn) CopyTo(to *TCPConn, operateType int) error

func (*TCPConn) DecodeRead

func (from *TCPConn) DecodeRead(data []byte) (n int, err error)

func (*TCPConn) DecodeWrite

func (from *TCPConn) DecodeWrite(data []byte) (int, error)

func (*TCPConn) EncodeWrite

func (from *TCPConn) EncodeWrite(data []byte) (int, error)

Jump to

Keyboard shortcuts

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