astropy / pyvo

An Astropy affiliated package providing access to remote data and services of the Virtual Observatory (VO) using Python.
https://pyvo.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
77 stars 52 forks source link

Support for proxies via requests #486

Open msbentley opened 1 year ago

msbentley commented 1 year ago

This may already be possible, but I finding it in the docs - is there support to pass the "proxies" keyword through pyvo to requests, in order to use e.g. SOCKS proxies to access servers behind firewalls etc.?

(use case - I want to test services running on development TAP servers, which can most easily be access through an SSH tunnel/SOCKS5 proxy - this functionality is built into requests, so I think it's just passing the relevant parameter through pyvo)

andamian commented 1 year ago

@msbentley - All the services, including TAPService accept a session in the constructor. I suspect you could create a requests.Session, set it up with your proxy info and use it to instance PyVO services. I haven't tried it myself, but please let us know if it does the trick.

bsipocz commented 1 year ago

If it works, please consider opening a PR and adding a section on it in the docs?