代理http代理服务器,实现自动密码输入,让不支持密码输入的http客户端使用func main() {logs.Info("http代理服务器的代理")proxyHttpProxy(":8080", "1.14.75.115:7777", "user", "pass")}func proxyHttpProxy(lAddr, addr, user, pass string) {// 构造待编码的字符串auth := user + ":" + pass// 对字符串进行base64编码encoded := base64.StdEncoding.EncodeToString([]byte(auth))authStr := fmt.Sprintf("Proxy-Authorization: Basic %s", encoded)listen, err := net.Listen("tcp", lAddr)if err != nil {logs.Err(err)return}for {accept, acceptErr := listen.Accept()if err != nil {logs.Err(acceptErr)continue}dial, err2 := net.Dial("tcp", addr)if err2 != nil {logs.Err(err2)continue}go
...
继续阅读
(32)