googlearchive / web-push-encryption

[Deprecated] Encryption Utilities for Web Push protocol
Apache License 2.0
84 stars 23 forks source link

allow proxy setting #33

Closed fbeauchamp closed 7 years ago

fbeauchamp commented 8 years ago

Hi , node-gcm allows a proxy parameter, is it possible to also implement it in push-encryption ?

Regards

Florent

gauntface commented 8 years ago

@fbeauchamp what would the use case be? Testing? (Sorry if thats a stupid question, but not come across node-gcm so not sure what it's for)

ptagl commented 8 years ago

Having a proxy setting in this module would help the deployment in scenarios where the server running it is behind a proxy.

I had a quick look at the code, and it seems like the request to the Google API uses the "request" module, and it should be really easy to allow the proxy setting.

Do you think it's possible?

Thanks!

Edit:

After searching better I've found a possible solution. The module is using "Request", and it supports environment variables, so if you run your NodeJS application like this:

HTTP_PROXY='http://myproxy.example:80' node myApp.js"

it works perfectly! :)