I would like to know if i could use a "pro-trick" to avoid defining the proxy in every imported module.
For example, i'm developping a small app using the FB API and when i send a request (in the prorgam) to get an object, i can't make it, because somewhere in the facebook module i have to define the proxy.
Same, while trying to access a web database, i fall into the proxy problem again...
Is there a way to set it up once for all, like for every outgoing connection of any python application -> go through proxy.
I know how to set it up manually for a urlopen standard request... but it's quite annoying to search into imported modules...
Just a short example for the facebook api (errno 10060 : too many blablabla... no answer... not working... go to hell)
- Code: Select all
token = 'blabla'
graph = facebook.GraphAPI(token)
profile = graph.get_object("me")
friends = graph.get_connections("me", "friends")
friend_list = [friend['name'] for friend in friends['data']]
Thanks for your help !