How to configure proxy using Squid

338 views Asked by At

I have a connection and I want change the connection behavior of the process to connect through that proxy. I would also like it to use a new IP in the event that it detects that it has been throttled.

The new connection process that I want is : connect from our server -> proxy -> required site if we are throttled: establish new connection through proxy (need to confirm new IP is being allocated by the proxy)

1

There are 1 answers

0
AudioBubble On BEST ANSWER

You can try this piece of code

import urllib2

proxy_support = urllib2.ProxyHandler({"http":"---url of proxy goes here---"})
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
urllib2.urlopen(---base-url goes here---).geturl()