proxy

package
v0.0.0-...-4ee70fb Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseError       = "0"
	ResponseOK          = "1"
	ResponseReset       = "2"
	ResponseRefused     = "3"
	ResponseUnknownHost = "4"
	ResponseTimeout     = "5"
)

Variables

View Source
var Server net.Listener

Functions

func Start

func Start(laddr string)

Types

type Client

type Client struct {
	Client       net.Conn
	Upstream     net.Conn
	UpstreamAddr *net.TCPAddr
	Username     string
	BindAddr     *net.TCPAddr
	TLS          bool
}

func MakeClient

func MakeClient(conn net.Conn) *Client

func (*Client) ConnectUpstream

func (c *Client) ConnectUpstream() error

func (*Client) Handshake

func (c *Client) Handshake() error

func (*Client) Pipe

func (c *Client) Pipe()

func (*Client) Run

func (c *Client) Run()

type ConnError

type ConnError struct {
	Msg  string
	Type string
}

func (*ConnError) Error

func (err *ConnError) Error() string

type HandshakeMeta

type HandshakeMeta struct {
	Host      string `json:"host"`
	Port      int    `json:"port"`
	TLS       bool   `json:"ssl"`
	Username  string `json:"username"`
	Interface string `json:"interface"`
}

type KiwiProxyConnection

type KiwiProxyConnection struct {
	Username       string
	ProxyInterface string
	DestHost       string
	DestPort       int
	DestTLS        bool
	State          KiwiProxyState
	Conn           *net.Conn
}

func MakeKiwiProxyConnection

func MakeKiwiProxyConnection() *KiwiProxyConnection

func (*KiwiProxyConnection) Close

func (c *KiwiProxyConnection) Close() error

func (*KiwiProxyConnection) Dial

func (c *KiwiProxyConnection) Dial(proxyServerAddr string) error

func (*KiwiProxyConnection) Read

func (c *KiwiProxyConnection) Read(b []byte) (n int, err error)

func (*KiwiProxyConnection) Write

func (c *KiwiProxyConnection) Write(b []byte) (n int, err error)

type KiwiProxyState

type KiwiProxyState int
const KiwiProxyStateClosed KiwiProxyState = 0
const KiwiProxyStateConnected KiwiProxyState = 3
const KiwiProxyStateConnecting KiwiProxyState = 1
const KiwiProxyStateHandshaking KiwiProxyState = 2

Jump to

Keyboard shortcuts

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