var clients = make(map[string]*http.Client)
func checkProxySOCKS(prox string, c chan QR, wg *sync.WaitGroup) (err error) {
defer wg.Done()
httpClient := clients[prox]
if httpClient == nil{
dialer, err := proxy.SOCKS5("tcp", prox, nil, proxy.Direct)
if err != nil {
return
}
timeout := time.Duration(1 * time.Second)
httpClient = &http.Client{
Timeout: timeout,
Transport: &http.Transport{
DisableKeepAlives: true,
Dial: dialer.Dial,
},
}
clients[prox]=httpClient
}
...
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.