Open armagaet opened 6 years ago
It is not necessary to modify the code!
requests
honors the environment variables HTTP_PROXY
and HTTPS_PROXY
. If set, these will be used automatically , see https://requests.readthedocs.io/en/latest/user/advanced/?highlight=proxies#proxies
It is not necessary to modify the code!
requests
honors the environment variablesHTTP_PROXY
andHTTPS_PROXY
. If set, these will be used automatically , see https://requests.readthedocs.io/en/latest/user/advanced/?highlight=proxies#proxies
Ok but how can I set these environment variable if the python code is launched from a browser?
@armagaet
import os
address = # enter your proxy address
port = # the proxy port
os.environ["HTTP_PROXY"] = f"{address}:{port}"
Sorry I'm not really at ease to the use of github. Anyway, for my purpose I've found useful to define a proxy in the WMS url request. I've modified, locally on my code, the req definition inside the "openURL" function, here:
"/usr/lib/python2.6/site-packages/owslib/util.py"
As this:
Hope to have been useful to someone, or maybe you have coded a better solution. This was fast and furious...
A.R.