classification
Title: urllib2 over SOCKS doesn't use proxy for DNS
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: OJW, jerome.radix, orsenthil, pitrou, torstenb
Priority: normal Keywords:

Created on 2011-03-02 14:51 by OJW, last changed 2011-06-09 22:13 by ezio.melotti. This issue is now closed.

Messages (2)
msg129899 - (view) Author: OJW (OJW) Date: 2011-03-02 14:51
#!/usr/bin/python
import socks
import socket

socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS4, "127.0.0.1", 9050, True)
socket.socket = socks.socksocket

import urllib2
print urllib2.urlopen("http://example.com/").read()


Expected result: all network communications go through SOCKS4A proxy

Actual result: DNS lookup of example.com goes through default gateway, followed by HTTP connection via the proxy
msg135522 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-05-08 13:28
Looks like a bug in the third-party "socks" module rather than in urllib. You should report it there.
History
Date User Action Args
2011-06-09 22:13:45ezio.melottisetstatus: pending -> closed
2011-05-08 13:28:23pitrousetstatus: open -> pending

nosy: + pitrou
messages: + msg135522

resolution: not a bug
2011-05-08 05:56:08torstenbsetnosy: + torstenb
2011-03-02 15:17:38orsenthilsetassignee: orsenthil

nosy: + orsenthil
2011-03-02 15:04:18jerome.radixsetnosy: + jerome.radix
2011-03-02 14:51:47OJWcreate