proxy

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DProxy = &Proxy{}

Functions

This section is empty.

Types

type Proxy

type Proxy struct{}

func (*Proxy) CreateFileServer

func (obj *Proxy) CreateFileServer(localPath string, relativePath string, port string, OnlyListenLocalAddr bool)

CreateFileServer 创建一个HTTP文件服务器,注意relativePath路径后要加斜杠 example:DNepal.CreateFileServer("C:\\lee\\project\\go\\auto", "/static/", "8888", true)

func (*Proxy) CreateFileServerByGin

func (obj *Proxy) CreateFileServerByGin(localPath string, relativePath string, port string, OnlyListenLocalAddr bool)

CreateFileServerByGin 创建一个HTTP文件服务器,通过gin框架

func (*Proxy) CreateHttpProxyClient

func (obj *Proxy) CreateHttpProxyClient(proxy string, timeout int) (*http.Client, error)

CreateHttpProxyClient 创建一个http代理客户端,代理类型由uri确定,支持http/https/socks5,默认为http http://fans007:fans888@45.76.169.156:39000

func (*Proxy) TestMulHttpProxy

func (obj *Proxy) TestMulHttpProxy(proxys []string, timeout int, maxG int, printLog bool) (success []string, fail []string)

TestMulHttpProxy 批量测试多个HTTP代理

func (*Proxy) TestOneHttpProxy

func (obj *Proxy) TestOneHttpProxy(proxy string, timeout int) (string, error)

TestOneHttpProxy 测试单个http代理是否可用

Jump to

Keyboard shortcuts

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