-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to define a proxy #34
Comments
I think your best bet is to look at the cloud API documentation https://docs.particle.io/reference/api/ and write code to access those HTTP endpoints through your proxy. It sounds like wrapping the particle-api-js module in a proxy module would be harder than wiring a couple HTTP calls from scratch. |
Basically I have stopped using this library and am doing the HTTP calls myself. That being said, this library provides a nice DSL, and some good practices around error handling and handling streams, which I would have to re-implement, and which I would love to avoid. Also, I imagine this library will continue to evolve as the api evolves, and so having the ability to just update this and be compatible with latest api would be great. |
Sure, if you'd like to investigate how to support proxies, go ahead. I'd love to see a pull request that adds the ability to inject additional superagent plugins, and puts information in the readme on how to add a proxy plugin. |
I would recommend avoiding |
I would like to push events and listen to event streams from a server inside a corporate proxy. From what I can gather from the code, there's no current way to define proxy settings for the requests the lib is doing to the particle cloud api.
It seems like for normal functions within the Particle module, superagent-proxy (https://github.com/TooTallNate/superagent-proxy) and a configurable flag could solve it, since it uses superagent for the requests.
For EventStream it will be trickier since it uses default node http/https libraries. I've implemented the EventStream solution using request and setting the proxy there.
The text was updated successfully, but these errors were encountered: