proxy

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

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

Go to latest
Published: Jun 2, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	net.Conn
	Reader *bytes.Reader
}

Conn is ...

func NewConn

func NewConn(conn net.Conn, r *bytes.Reader) *Conn

NewConn is ...

func (*Conn) CloseRead

func (c *Conn) CloseRead() error

CloseRead is ...

func (*Conn) CloseWrite

func (c *Conn) CloseWrite() error

CloseWrite is ...

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

Read is ...

type Listener

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

Listener is ... net.Listener accept connections bypassed by Server.handshake

func NewListener

func NewListener(addr net.Addr) *Listener

NewListener is ...

func (*Listener) Accept

func (s *Listener) Accept() (net.Conn, error)

Accept is ...

func (*Listener) Addr

func (s *Listener) Addr() net.Addr

Addr is ...

func (*Listener) Close

func (s *Listener) Close() error

Close is ...

func (*Listener) Receive

func (s *Listener) Receive(conn net.Conn)

Receive is ...

type PacketConn

type PacketConn struct {
	*net.UDPConn
	// contains filtered or unexported fields
}

PacketConn is ... gonet.PacketConn

func NewPacketConn

func NewPacketConn(src net.Addr, conn *net.UDPConn) *PacketConn

NewPacketConn is ...

func (*PacketConn) ReadTo

func (c *PacketConn) ReadTo(b []byte) (n int, addr net.Addr, err error)

ReadTo is ...

func (*PacketConn) RemoteAddr

func (c *PacketConn) RemoteAddr() net.Addr

RemoteAddr is ...

func (*PacketConn) WriteFrom

func (c *PacketConn) WriteFrom(b []byte, addr net.Addr) (n int, err error)

WriteFrom is ...

type Server

type Server struct {
	// Logger is ...
	Logger logger.Logger
	// Route is ...
	Router *http.ServeMux
	// Server is ...
	// serve http.Request
	Server http.Server
	// Listener is ...
	Listener net.Listener
	// Handler is ...
	// gonet.Handler
	Handler gonet.Handler
	// contains filtered or unexported fields
}

Server is ... a combined socks5/http proxy server

func NewServer

NewServer is ...

func (*Server) Close

func (s *Server) Close() error

Close is ...

func (*Server) Handshake

func (s *Server) Handshake(conn net.Conn) (uc *net.UDPConn, buf []byte, ok bool, err error)

Handshake is ...

func (*Server) LookupIP

func (s *Server) LookupIP(ip net.IP, b []byte) (*socks.Addr, error)

LookupIP is ...

func (*Server) ParseAddr

func (s *Server) ParseAddr(host, port string, b []byte) (*socks.Addr, error)

ParseAddr is ...

func (*Server) ProxyConnect

func (s *Server) ProxyConnect(w http.ResponseWriter, r *http.Request)

ProxyConnect is ... handle http proxy CONNECT method

func (*Server) ProxyGet

func (s *Server) ProxyGet(w http.ResponseWriter, r *http.Request)

ProxyGet is ... handle http proxy GET method

func (*Server) ProxySocks

func (s *Server) ProxySocks(conn gonet.Conn, uc *net.UDPConn, buf []byte)

ProxySocks is ... handle socks5 proxy

func (*Server) Serve

func (s *Server) Serve()

Serve is ... accept net.Conn

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

serve as a http server and http proxy server support GET and CONNECT method

Jump to

Keyboard shortcuts

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