예제 #1
0
파일: main.go 프로젝트: xlvector/socks
func socksClient(ip string, block *Block) *http.Client {
	dialSocksProxy := socks.DialSocksProxy(socks.SOCKS5, ip, time.Second*10)
	tr := &http.Transport{Dial: dialSocksProxy, ResponseHeaderTimeout: time.Second * 10}
	return &http.Client{
		Transport: tr,
		CheckRedirect: func(req *http.Request, via []*http.Request) error {
			log.Println("redirect to:", req.URL.String(), ip)
			block.block(ip)
			return errors.New("does not allow redirect")
		},
	}
}
예제 #2
0
파일: main.go 프로젝트: xlvector/socks
func socksClient(ip string) *http.Client {
	dialSocksProxy := socks.DialSocksProxy(socks.SOCKS5, ip, time.Second*10)
	tr := &http.Transport{Dial: dialSocksProxy, ResponseHeaderTimeout: time.Second * 10}
	return &http.Client{Transport: tr}
}
예제 #3
0
파일: main.go 프로젝트: xlvector/socks
func socksClient(ip string, tp int) *http.Client {
	dialSocksProxy := socks.DialSocksProxy(tp, ip, time.Second*2)
	tr := &http.Transport{Dial: dialSocksProxy}
	return &http.Client{Transport: tr}
}