Skip to main content

Is there a way to configure a proxy host for the sentinelhub-py requests? Currently all requests by the python tools are blocked by our firewall, hence I need to use a proxy to get through, but couldn’t find any mention about proxies in the shub-py documentation.

In principle it should be possible as one can configure base urls for SH services via SHConfig. Is there any chance you can set up a proxy on your side?


@batic - I believe proxy is already running.


So the only thing needed to be done is the change of the services in config.py, e.g. this part
'sh_base_url': 'https://services.sentinel-hub.com',

?


Sorry, my response was off.


sentinelhub-py uses requests library, which picks up environmental variables for proxy as well:


$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"

(taken from here)


Thanks! Using the environmental variables solved the problem.


Note that this method may not cover all scenarios, and you may need to adapt it to your specific requirements. Also, check the SentinelHub documentation or community forums for updates or changes regarding proxy support in the sentinelhub-py library since my last update. And remember, it’s not easy to buy proxies because you need to find a company you can trust. When working with proxy servers, always follow the terms of service of the services you use, including SentinelHub.


Reply