Skip to main content

Proxy host for sentinelhub-py

  • April 26, 2024
  • 6 replies
  • 663 views

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.

6 replies

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?


Thanks! Using the environmental variables solved the problem.


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)


@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',
?


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.


cakomet
Forum|alt.badge.img
  • ‎‎ 🌱
  • July 1, 2026

Yes. sentinelhub-py uses the requests library under the hood, so proxies aren't configured within the library itself, you just set the standard HTTP_PROXY and HTTPS_PROXY environment variables and it'll pick them up automatically. I found this to be the simplest way to handle it without touching any code. If your proxy needs authentication, include the username and password directly in the proxy URL. Just make sure these are set before you import or initialize the sentinelhub-py client, since the environment needs to be in place beforehand.