notifme / notifme-sdk

A Node.js library to send all kinds of transactional notifications.
https://notifme.github.io/www/
MIT License
1.94k stars 149 forks source link

Support of http proxy in option #33

Closed KeanuPang closed 6 years ago

KeanuPang commented 6 years ago

In node-fetch, we can pass a http.Agent with custom proxy settings in options with node-https-proxy-agent.

So maybe we can set http/https proxy settings in option from NotifmeSdk or read from environment variables like http_proxy and https_proxy, then all providers just read this option and pass it to node-fetch.

ref: https://github.com/bitinn/node-fetch/issues/79 https://github.com/bitinn/node-fetch/issues/195

BDav24 commented 6 years ago

Ok, I'll look into it.

BDav24 commented 6 years ago

@KeanuPang You can now pass a NOTIFME_HTTP_PROXY env variable. If it's set, it'll create a node-https-proxy-agent.

https://github.com/notifme/notifme-sdk/pull/34 https://github.com/notifme/notifme-sdk/releases/tag/v1.6.0

KeanuPang commented 6 years ago

It's great works, I love this library notifme. Thank you.

BDav24 commented 6 years ago

@KeanuPang Thanks, I'm glad to hear that. If I may ask, could you tell me how you use this lib? (context, providers...) It's useful to know in order to improve it ;)