1

If I set network proxy in network settings on my computer (gnome 3 , fedora) when I do post get reuests in my python script will they go through the proxy or through direct connection?

what will python use? chrome browser gets proxified when I set proxy in neetwork, same for python?

if so how to use direct connection from python? like firefox does

1 Answer 1

1

This depends on how you connect to remote servers via Python. The urllib and urllib2 libraries will honour the *_PROXY environment variables (e.g. HTTP_PROXY, HTTPS_PROXY, etc.). From the urllib documentation page:

The urlopen() function works transparently with proxies which do not require authentication. In a Unix or Windows environment, set the http_proxy, or ftp_proxy environment variables to a URL that identifies the proxy server before starting the Python interpreter.

Note that you can also use the NO_PROXY environment variable to list exceptions.

You'll need to be more specific about your Python network usage to be any more specific.

Sign up to request clarification or add additional context in comments.

2 Comments

thnx thats what I'm looking for, so by default if no http_proxy option is set python will go through direct connection right?
Exactly. You can also use the no_proxy environment variable to list exceptions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.