lbdremy / solr-node-client

A solr client for node.js.
http://lbdremy.github.com/solr-node-client
MIT License
484 stars 207 forks source link

Support for proxy servers? #195

Open nfriedly opened 7 years ago

nfriedly commented 7 years ago

There doesn't appear to be any way to use solr-client with the connection tunneled through a http proxy, which would be a helpful feature for some users.

I notice that it uses request for one or two connections, but Node's built-in http library for the majority of things. request has built-in proxy support (and it can even be configured with environment properties) - so enabling proxy support might be fairly simple.

Is this a feasible change, either through request or some other method?

This is related to https://github.com/watson-developer-cloud/node-sdk/issues/421

nfriedly commented 7 years ago

Per https://github.com/watson-developer-cloud/node-sdk/issues/421#issuecomment-287428644, it sounds like just switching in request for http/https will work.

yatszhash commented 7 years ago

I implemented nifriedly's idea on my branch. It works via proxy. If there isn't any reason to use http or https module instead of request module, I want to send a pull request after adding the tests and formating the code.

nicolasembleton commented 7 years ago

Please do @yatszhash. Always useful and welcomed.

rudolfbyker commented 3 years ago

I think the best approach would be to make the request back end pluggable, allowing the user to provide their own instance of http, https, request or axios.

Also, the maintainers of request seem to prefer that we stop using it, although this may be interpreted differently: https://github.com/request/request/issues/3142