zotero / translation-server

A Node.js-based server to run Zotero translators
Other
123 stars 52 forks source link

Configuration of proxy server #54

Closed akosiaris closed 6 years ago

akosiaris commented 6 years ago

I am trying to figure out how to configure an outgoing proxy for translation-server and I 'll admit I am a bit confused.

Assuming I want to access https://www.nytimes.com/2018/06/11/technology/net-neutrality-repeal.html and my proxy is myproxy.example.org:8080 how should I be going around for that?

akosiaris commented 6 years ago

After some efforts on this one and a lot of useless searching under https://github.com/zotero/translation-server/blob/master/src/proxy.js and https://github.com/zotero/translation-server/blob/master/src/webSession.js it became clear that settings HTTP_PROXY and HTTPS_PROXY env variables does the trick. This also uncovered an interesting bug in url.parse() from the nodejs url module where not passing the URL scheme (e.g. 10.10.10.10:8080 instead of http://10.10.10.10:8080) would cause issues as the input was misinterpreted. But this is not a fault of zotero

akosiaris commented 6 years ago

Leaving this open in order to document this. I 'll try and post a PR soon

akosiaris commented 6 years ago

Thanks @dstillman !