Skip to content

Commit 11118c3

Browse files
authored
Update README.md
1 parent e578954 commit 11118c3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ A node.js module for interfacing with Apple Push Notification, Google Cloud Mess
2121
- [ADM](#adm)
2222
- [Web-Push](#web-push)
2323
- [Resources](#resources)
24+
- [Proxy](#proxy)
2425
- [LICENSE](#license)
2526

2627
## Installation
@@ -684,6 +685,27 @@ webPush.sendNotification(regId, payload, settings.web);
684685
685686
A working server example implementation can be found at [https://github.com/alex-friedl/webpush-example/blob/master/server/index.js](https://github.com/alex-friedl/webpush-example/blob/master/server/index.js)
686687
688+
## Proxy
689+
690+
To use the module with a proxy:
691+
692+
import { HttpsProxyAgent } from 'https-proxy-agent';
693+
...
694+
const settings = {
695+
fcm: {
696+
...,
697+
httpAgent = new HttpsProxyAgent(`http://${env.proxy.host}:${env.proxy.port}`);
698+
},
699+
apn: {
700+
...
701+
proxy: {
702+
host: <proxy_address>,
703+
port: <proxy_port>
704+
}
705+
}
706+
};
707+
708+
687709
## Resources
688710

689711
- [Crossplatform integration example using this library and a React Native app](https://github.com/alex-friedl/crossplatform-push-notifications-example)

0 commit comments

Comments
 (0)