1.先上代码
package main
import (
"crypto/tls"
"flag"
"fmt"
"io/ioutil"
"net/http"
"net/url"
)
func main() {
u := flag.String("u", "http://www.baidu.com", "get url")
p := flag.String("p", "http://127.0.0.1:1081", "proxy string")
flag.Parse()
err := useProxyFromEnvironment(*u)
if err != nil {
fmt.Println(err)
return
}
err = useProxyURL(*