vproxy

package module
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

vproxy Build Status

golang proxy, HTTP/HTTPS proxy server, HTTP/HTTPS 代理服务器

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	OriginAddr   LogLevel = iota + 1 // 登录 vproxy 每个请求的目标。
	Authenticate                     // 认证
	Host                             // 访问的Host地址
	URI                              // 路径
	Request                          // 显示报头解析
	Response                         // 日志写入到网络的所有数据
	Error                            // 非致命错误
)

type Proxy

type Proxy struct {
	// 这个支持单条连接。不要使用在浏览器中。
	// 支持:
	// http://192.168.2.31/http://www.baidu.com/
	// http://192.168.2.31/?url=http://www.baidu.com/
	LinkPosterior bool                                                                 // 支持连接后面的,如:http://192.168.2.31/http://www.baidu.com/
	DataBufioSize int                                                                  // 缓冲区大小
	Auth          func(username, password string) bool                                 // 认证
	Addr          string                                                               // 代理IP地址
	Server        http.Server                                                          // 服务器
	DialContext   func(ctx context.Context, network, address string) (net.Conn, error) // 拨号
	ErrorLog      *log.Logger                                                          // 日志
	ErrorLogLevel LogLevel                                                             // 日志级别

	Tr          http.RoundTripper // 代理
	CertManager *autocert.Manager // 自动申请证书 Let's Encrypt
	// contains filtered or unexported fields
}

func (*Proxy) Close

func (p *Proxy) Close() error

Close 关闭

func (*Proxy) ListenAndServe added in v1.1.1

func (p *Proxy) ListenAndServe() error

ListenAndServe 开启监听

返:
    error       错误

func (*Proxy) Serve

func (p *Proxy) Serve(l net.Listener) error

Serve 开启监听

参:
    l net.Listener  监听对象
返:
    error           错误

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP 处理服务

rw http.ResponseWriter  响应
req *http.Request       请求

Directories

Path Synopsis
cmd
main command

Jump to

Keyboard shortcuts

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