Skip to content
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

FR:Support proxy for local testing #253

Closed
perqin opened this issue Apr 8, 2018 · 3 comments
Closed

FR:Support proxy for local testing #253

perqin opened this issue Apr 8, 2018 · 3 comments
Assignees

Comments

@perqin
Copy link

perqin commented Apr 8, 2018

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Linux archlinux 4.15.15-1-ARCH #1 SMP PREEMPT Sat Mar 31 23:59:25 UTC 2018 x86_64 GNU/Linux
  • Library version: 5.12.0
  • Firebase Product: Cloud Messaging

[REQUIRED] Step 3: Describe the problem

My local computer is behind proxy so the Node.js Admin SDK can't send the request to FCM server. It will be great if it supports HTTP proxy or proxy agent.

@p2k
Copy link

p2k commented Jun 22, 2018

You can try this package as a workaround until it is supported officially:
https://github.com/np-maintain/global-tunnel

@hiranya911
Copy link
Contributor

hiranya911 commented Jul 9, 2018

We can probably support specifying an HTTP/S agent as an AppOption.

const tunnel = require('tunnel');

admin.initializeApp({
  httpsAgent: tunnel.httpsOverHttps({
    proxy: {
      host: 'my.proxy.host',
      port: 3128,
    },
  }),
});

Users will have to install tunnel (or an equivalent library) and initialize the Admin SDK as shown above. Does that sound like a reasonable solution?

Gyunikuchan pushed a commit to Gyunikuchan/firebase-admin-node that referenced this issue Nov 5, 2018
Gyunikuchan pushed a commit to Gyunikuchan/firebase-admin-node that referenced this issue Nov 5, 2018
Gyunikuchan pushed a commit to Gyunikuchan/firebase-admin-node that referenced this issue Nov 9, 2018
Gyunikuchan pushed a commit to Gyunikuchan/firebase-admin-node that referenced this issue Nov 9, 2018
Gyunikuchan added a commit to Gyunikuchan/firebase-admin-node that referenced this issue Nov 12, 2018
@hiranya911
Copy link
Contributor

#402 implements the support for specifying an http.Agent for the SDK. This use case should be supported now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants