mirror of
				https://github.com/taigrr/godns
				synced 2025-01-18 04:03:25 -08:00 
			
		
		
		
	Merge pull request #57 from jemyzhang/master
proxy should not be used while getting public ip
This commit is contained in:
		
						commit
						4ca167ac43
					
				
							
								
								
									
										13
									
								
								utils.go
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								utils.go
									
									
									
									
									
								
							| @ -159,19 +159,6 @@ func GetCurrentIP(configuration *Settings) (string, error) { | ||||
| func GetIPOnline(configuration *Settings) (string, error) { | ||||
| 	client := &http.Client{} | ||||
| 
 | ||||
| 	if configuration.Socks5Proxy != "" { | ||||
| 		log.Println("use socks5 proxy:" + configuration.Socks5Proxy) | ||||
| 		dialer, err := proxy.SOCKS5("tcp", configuration.Socks5Proxy, nil, proxy.Direct) | ||||
| 		if err != nil { | ||||
| 			log.Println("can't connect to the proxy:", err) | ||||
| 			return "", err | ||||
| 		} | ||||
| 
 | ||||
| 		httpTransport := &http.Transport{} | ||||
| 		client.Transport = httpTransport | ||||
| 		httpTransport.Dial = dialer.Dial | ||||
| 	} | ||||
| 
 | ||||
| 	var response *http.Response | ||||
| 	var err error | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user