Android 谷歌gcm推送所需要的端口


          如果有人做过谷歌gcm的推送功能,就会想知道,如果将注册访问谷歌网站的服务放到服务器上,为了安全起见,就会要求只能开通对应的谷歌服务端口,经过一番查找,记录如下:

 

I've finally figured out what the problem is. The corporate firewall is blocking traffic on the native GCM port of 5228. (5229 and 5230 are also mentioned with relation to GCM but we're not seeing any attempted traffic on those ports at all.) This much is well documented elsewhere (just Google GCM port 5228).

What I can't find clearly documented anywhere, but we've figured out from our server logs and from running Connection Tracker on the handsets, is that newer versions of Android fall back to using port 443 (the standard HTTPS port) which most firewalls allow traffic through by default. This is how our devices running newer Android versions are working even behind the firewall. I don't know precisely what Android version introduced this port 443 fallback, but it's somewhere between 4.1.2 (not working) and 4.3 (working).
Note: If your organization has a firewall that restricts the traffic to or from the Internet, 
you need to configure it to allow connectivity with GCM in order for your GCM client apps to receive messages. 
The ports to open are: 5228, 5229, and 5230. GCM typically only uses 5228, but it sometimes uses 5229 and 5230. 
GCM doesn't provide specific IPs, so you should allow your firewall to accept outgoing connections to all IP addresses contained 
in the IP blocks listed in Google's ASN of 15169.

上面以上的英文意思其实就是说访问谷歌的服务器地址是https的,(服务器地址为http://android.googleapis.com/):需要出站的端口是433,还有谷歌必须的服务出站端口是:5228,5229,5230

      记录一下,希望对有些需要的朋友有用。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值