如果有人做过谷歌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

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

更多相关文章

  1. 移动应用开发辅助服务推荐
  2. 关于getSystemService
  3. Android入门进阶教程(13)-ServiceManager服务管理详解
  4. android组件之Service
  5. 采用MQTT协议实现Android消息推送
  6. android socket通讯,PC和模拟器,两个模拟器之间的通信
  7. c++服务器与android客户端进行文件传输功能的实现
  8. Android(安卓)使用Socket实现服务器与手机客户端的长连接四:使用
  9. android Java 提交数据到服务器的两种方式中四种方法

随机推荐

  1. ANDROID工作学习笔记之ANDROID:SCALETYPE
  2. Android 屏幕常亮 背景常亮
  3. android shape使用总结
  4. 整理的一些免费课程分享
  5. Android View预估大小
  6. Material Design综合实例
  7. Android Intents and Intent Filters
  8. Android Toast提示封装
  9. [Android]查看KeyStore的MD5或SHA1签名
  10. Android(安卓)ApiDemos示例解析(106):Vie