tags:

views:

86

answers:

4

how can i increase speed of socket in python ? my code :

import urllib
proxies = {'http': 'http://75.21.47.2:8080/'}
opener = urllib.FancyURLopener(proxies)
r = opener.open("http://www.python.org/")
print r.read()
A: 

What is the baud rate you are using? You can probably increase it.

Ok, now once the question has been cleared, I shall recommend to opt for a better solution (like implementing your own) rather than using the public proxy service. It is slow.

Kangkan
If any one is down voting, please put your feedback.
Kangkan
+2  A: 

75.21.47.2:8080 seems to be a public HTTP proxy server? these are invariably slow because of what they are.

If you want better performance via a proxy, implement your own or use a commercial service.

Alex K.
A: 

Measure all stages of the pipeline (Opening the connection, sending the message, receiving the response etc.). Figure out where the largest bang for the buck is and think of a way to do it. From your question, the only answer is Kimvais's - Buy a better internet!

Noufal Ibrahim
A: 

Thought about compression? Sure, depends on what you're doing, but if possible it should definitely be used.

Felix