httpproxy

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

参考资料

curl测试

 curl -x http://proxy:proxy@127.0.0.1:8080/ -I https://www.jd.com/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomString

func GetRandomString(l int) string

func Run

func Run(cfg *Cfg)

Types

type BaseAuth

type BaseAuth struct {
	IsBaseAuth bool   // 需要BaseAuth认证
	UserName   string // 账号
	PassWord   string // 密码
}

BaseAuth http基础认证

type Cfg

type Cfg struct {
	Addr        string   // 监听地址
	Port        string   // 监听端口
	IsAnonymous bool     // 高匿名模式
	Debug       bool     // 调试模式
	BaseAuth    BaseAuth // 基础认证
}

设置type

type Pxy

type Pxy struct {
	Cfg Cfg
}

func NewPxy

func NewPxy() *Pxy

实例化

func (*Pxy) HTTP

func (p *Pxy) HTTP(rw http.ResponseWriter, req *http.Request)

http

func (*Pxy) HTTPS

func (p *Pxy) HTTPS(rw http.ResponseWriter, req *http.Request)

https

func (*Pxy) ServeHTTP

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

运行代理服务

func (*Pxy) SetPxyCfg

func (p *Pxy) SetPxyCfg(cfg *Cfg)

配置参数

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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