lix-pm / lix.client

A dependable package manager for your Haxe projects
The Unlicense
119 stars 24 forks source link

[Feature] Support for HTTP proxy #29

Open zicklag opened 6 years ago

zicklag commented 6 years ago

I want to use Lix, but I am behind an HTTP proxy. It would be great to add support for using Lix behind a proxy. I would actually be willing to help out and try to work on this, but I wanted to know if the owners of this project have any preference on how it is implemented.

I am on an Ubuntu machine and I would definitely like it if Lix would be able to read my http_proxy environment variables and configure the proxy accordingly. It does seem like it might be a good idea to add a proxy configuration subcommand as well.

zicklag commented 6 years ago

Unfortunately the Haxe standard library doesn't support specifying a proxy for the Javascript platform. :frowning: It does make sense, though, because if you are running in a browser, the browser handles the proxy for any requests made by your script. That approach doesn't work for Node, though. It doesn't look like the builtin Node API has any support for making a proxied request either.

NPM uses the request library to make its proxied requests. Would there be any reason not to add that package as a dependency to Lix? That would probably make this easy; request even respects http_proxy environment variables.

If there is a reason not to add request I could probably write a pure Haxe class that does the proxying using request as a reference.

kevinresol commented 6 years ago

Maybe tink_http should add proxy support and lix should use that

zicklag commented 6 years ago

I like the sound of that. It would great if there was a completely cross-platform way to make http/https requests through a proxy. If tink_http can make requests from node that would be a good place to implement this. And it would mean that any other Haxe projects that need proxy support could use the library as well.

damoebius commented 5 years ago

I'm also behind a proxy. Any update on that ?

zicklag commented 5 years ago

Unfortunately haven't gotten to work on it: https://github.com/haxetink/tink_http/issues/90#issuecomment-470180534.

kevinresol commented 5 years ago

Perhaps using OS-level proxy as a workaround?