我们正在运行一个简单的应用程序,该应用程序连接到Firebase会读取一些数据.它无法连接,并显示以下超时错误:
We are running a simple application that connects to Firebase are reads some data. It fails to connect with the following timeout error:
@firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential", "message":"Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"Failed to parse access token response: Error: Error while making request: connect ETIMEDOUT我们在防火墙/代理后面,并且似乎阻止了往返Firebase的通信,因此连接失败.我的问题是,需要打开哪些端口以及要使用哪个目标URL才能使该应用程序正常工作?
We are behind Firewall / Proxy and it appears that is blocking traffic to/from Firebase and hence failed connection. My question is what ports need to be opened and to what destination URLs to make this application work normally?
任何帮助将不胜感激!
推荐答案最后,在为问题苦苦挣扎了几天之后,它开始工作了.需要联系网络团队并要求执行以下操作:
Finally, after struggling with the issue for several days got it working. Needed to contact network team and request to perform following actions:
在源服务器和以下URL之间的代理级别打开通信:
Opened communication at proxy level between the source server and following URLs:
fcm.googleapis
fcm.googleapis
gcm-http.googleapis
gcm-http.googleapis
accounts.google
accounts.google
{project-name} .firebaseio
{project-name}.firebaseio
在我的node.js应用程序中添加了以下代码:
Added following code in my node.js application:
var globalTunnel = require('global-tunnel-ng'); globalTunnel.initialize({ host: '<proxy-url>', port: <proxy-port>, //proxyAuth: 'userId:password', // optional authentication sockets: 50 // optional pool size for each http and https });
已安装模块global-tunnel-ng:
npm install global-tunnel-ng
它解决了我的问题,希望也能对其他人有所帮助. :-)
It solved the my problem and I hope it can help others too. :-)
更多推荐
如何在防火墙/代理后面使用Firebase?
发布评论