go语言使用代理访问网址--goKit
Go

go语言使用代理访问网址--goKit

247
247
2024-07-14 / 0 评论 / 28 阅读 / 正在检测是否收录...
http和https网页均可适用
go get github.com/xingcxb/goKit
package main

import(
    "fmt"
    "github.com/xingcxb/goKit/core/httpKit"
)

func main() {
    /// get请求
    // 白名单认证
    fmt.Println(httpKit.HttpProxyGet("https://cip.cc", "22.33.44.55:59582"))
    fmt.Println("------------------>")
    // 用户名密码认证
    fmt.Println(httpKit.HttpProxyGetFull("https://cip.cc", nil, nil,
        "", 300, "http", "username", "password",
        "22.3.44.55:9582"))
    fmt.Println("------------------>")
    /// post请求
    // 白名单认证
    fmt.Println(httpKit.HttpProxyPost("https://cip.cc", nil, "22.33.44.55:59582"))
    fmt.Println("------------------>")
    // 用户名密码认证
    fmt.Println(httpKit.HttpProxyPostFull("https://cip.cc", nil, nil,
        "", 300, "http", "username", "password", "22.33.44.55:59582"))
}
0

评论 (0)

取消