Raudius / Pushraven

A simple Java library to interface with Firebase Cloud Messaging (FCM) API. Pushraven allows you to push notifications to clients in very few lines of code.
MIT License
78 stars 34 forks source link

push(), getToken() and other http methods fail if behind a proxy #24

Closed mdip closed 2 years ago

mdip commented 5 years ago

It would be great to set a proxy parameter to pass it to the .openConnection() methods.

Raudius commented 5 years ago

It should be fairly simple to add a proxy parameter to the push method, But for the getAccessToken() method to work you will need to set the environment variables:

System.setProperty("https.proxyHost", "localhost");
System.setProperty("https.proxyPort", "3128");

Would this be an acceptable solution or can you suggest a better way perhaps?

I can also look into retrieving the Google credential manually, instead of using the google-api-client dependency.