gpt4 book ai didi

Android FCM - 防火墙的 IP 和端口是什么?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:53:13 25 4
gpt4 key购买 nike

我们在受限环境中的服务器需要将通知推送到安装了我们应用程序的设备。我们在开放环境中试用了我们的推送客户端,它成功了。然而,当移动到我们的服务器时,由于防火墙阻塞而出现网络错误。

基于谷歌文档:

If your organization has a firewall that restricts the traffic to orfrom the Internet, you need to configure it to allow connectivity withFCM in order for your Firebase Cloud Messaging client apps to receivemessages. The ports to open are: 5228, 5229, and 5230. FCM typicallyonly uses 5228, but it sometimes uses 5229 and 5230. FCM doesn'tprovide specific IPs, so you should allow your firewall to acceptoutgoing connections to all IP addresses contained in the IP blockslisted in Google's ASN of 15169.

但是,我们实际上是使用HTTP协议(protocol)推送,URL如下:

https://fcm.googleapis.com/fcm/send

这是否意味着要打开的端口现在是 443 而不是 5228

此外,我们还需要配置主机,因为安全团队不允许我们连接到域。从上面的段落中,所有 IP 地址都在 ASN 15169 中,我只设法找到一个列表 here

谁有这方面的经验可以指点一下吗?谢谢。

最佳答案

Does that means the port to open is now 443 instead of 5228?

接收消息

您应该根据 documentation 打开 5228、5229 和 5230 .

发送消息

FCM 不提供特定 IP,因为我们的 IP 范围变化太频繁,您的防火墙规则可能会过时,从而影响您的用户体验。理想情况下,您会将端口 5228-5230 列入白名单,没有 IP 限制。

但是,如果您必须有 IP 限制,则应将 Google's ASN of 15169 中列出的 IPv4 和 IPv6 block 中的所有 IP 地址列入白名单。 .这是一个很大的列表,您应该计划每月更新您的规则。

关于Android FCM - 防火墙的 IP 和端口是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45529020/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com