python socket problem

Posted by uytg on Stack Overflow See other posts from Stack Overflow or by uytg
Published on 2010-05-11T11:31:40Z Indexed on 2010/05/11 11:34 UTC
Read the original article Hit count: 515

Filed under:
|
|

I write this python code:

import socks
import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "64.83.219.7", 58279)
socket.socket = socks.socksocket
socket.setdefaulttimeout(19)
import urllib2
print urllib2.urlopen('http://www.google.com').read()

but when I execute it, I get this error:

urllib2.URLError: <urlopen error timed out>

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about python

Related posts about socket