简体   繁体   English

GCM XMPP服务器认证

[英]GCM XMPP server authentication

I'm trying to implement googls example of GCM server as discribed here: Writing the Server Code 我正在尝试实现此处描述的GCM服务器的googls示例: 编写服务器代码

and i'm getting the following error: 我收到以下错误:

DEBUG: socket       sent  <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">...</auth>
DEBUG: socket       error Socket error while receiving data
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/xmpp/transports.py", line 146, in receive
    try: received = self._recv(BUFLEN)
SSLError: [Errno 8] _ssl.c:1325: EOF occurred in violation of protocol
DEBUG: socket       error Socket operation failed
Authentication failed!

My server is behind a NAT and firewall. 我的服务器位于NAT和防火墙之后。 I've opened a rule for outgoing connection to ANY and forwarded ports 5228-5230, as mentioned here . 我已经打开的任何及转发端口5228-5230传出连接的规则,提到这里 Though, because of resources issues I can't forward all ports to the server, neither 80 or 443. 但是,由于资源问题,我无法将所有端口都转发到服务器,无论是80还是443。

Any ideas on what causing this error and can I resolve it? 关于导致此错误的原因有什么想法,我可以解决吗?

Thanks. 谢谢。

I'm not sure if that's your only problem, but you opened the wrong ports : 我不确定这是否是您唯一的问题,但是您打开了错误的端口:

GCM Cloud Connection Server (CCS) is an XMPP endpoint, running on http://gcm.googleapis.com port 5235 . GCM云连接服务器(CCS)是XMPP端点,在http://gcm.googleapis.com端口5235上运行。

The ports that you opened are only required for your Android device to receive messages from the GCM server when your device is connected to the internet via WiFi : 仅当您的设备通过WiFi连接到Internet时,打开的端口才是Android设备从GCM服务器接收消息所必需的端口:

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 Android devices to receive messages . 注意:如果您的组织有一个防火墙,它限制了进出Internet的流量,则需要对其进行配置以允许与GCM进行连接, 以便您的Android设备接收消息 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. 打开的端口是:5228、5229和5230。GCM通常仅使用5228,但有时使用5229和5230。GCM不提供特定的IP,因此您应允许防火墙接受到所有包含的IP地址的传出连接在Google的15169 ASN中列出的IP块中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM