-
Notifications
You must be signed in to change notification settings - Fork 304
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
ETIMEDOUT in sendNotification.Can it add a proxy option? #280
Comments
What options would you need? |
Like
So that the web-push can request the google url through my proxy server. |
I'd happily accept a pull request for this. You can also implement the same without using a standard proxy. Just change the endpoint URL to be the URL of your custom proxy (e.g. YOUR_PROXY_URL?endpoint=ACTUAL_ENDPOINT_URL) and make the proxy send the request to the endpoint URL. |
Oh,that's a good idea~ But actually the proxy server is not mine, and i can do nothing on it to build such custom api. |
Hey due. I've forked your repo and add proxy api. But after serious consideration, i think it's not necessary to pull request. There are three reasons:
So it's better to make it an independent repo, and this is the link |
Note that it's not only Chinese developers that are affected by this problem. If you are behind a corporate proxy, which is common in big organisations, you encounter the same issue. Having the ability to set a proxy, or better, respecting the HTTP(S)_PROXY environment variables, would benefit these users. That said, #282 provides exactly this functionality, so I think the focus should be on integrating that PR. Just my two cents! |
Oh. I have not noticed that PR. It's really good if the official lib implements that API. Thanks for contributing!! |
Hi there, |
I think so, until #282 is finished up and merged. |
Thank for the update regarding this. |
I hacked the library to be able to bypass this issue of proxy here are the changes that I brought to the library const HttpsProxyAgent = require('https-proxy-agent');
i just use https-proxy-agent module this solution will just work behind proxy server , now i'm trying to report changes that will make the module function whether you're behind a proxy or not |
@anasameur if you want, you can pick up the already existing PR (#282) and finish it. |
Fixed by #319. |
I've already used webpush.sendNotification and it automatically request the Google server address.But I received so many ETIMEDOUT.
For the server in China, the network is unluckily blocked by gov, so we have to use proxy server to link websites abroad.
Hope the web-push can add proxy options.
The text was updated successfully, but these errors were encountered: