如果有人做过谷歌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
记录一下,希望对有些需要的朋友有用。