[issue11375] urllib2 over SOCKS doesn't use proxy for DNS

OJW report at bugs.python.org
Wed Mar 2 15:51:48 CET 2011


New submission from OJW <owhite at yahoo.com>:

#!/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

----------
components: Library (Lib)
messages: 129899
nosy: OJW
priority: normal
severity: normal
status: open
title: urllib2 over SOCKS doesn't use proxy for DNS
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11375>
_______________________________________


More information about the Python-bugs-list mailing list