I\'m trying to open a XMPP connection between my server and the Google Cloud Connection Server (CCS), but it doesn´t work. I´m programming with PHP and using the JAXL librar
Perhaps you should change the host
to http://gcm.googleapis.com. Your error says "unable to connect tcp://gcm.googleapis.com:5235".
GCM Cloud Connection Server (CCS) is an XMPP endpoint, running on http://gcm.googleapis.com port 5235.
You should connect to gcm.googleapis.com by ssl, not http or tcp.
I fixed this by modifying jaxl.php from:
public function get_socket_path() {
return ($this->cfg['port'] == 5223 ? "ssl" : "tcp")."://".$this->cfg['host'].":".$this->cfg['port'];
}
to:
public function get_socket_path() {
return ($this->cfg['port'] == 5223 || $this->cfg['ssl'] == true ? "ssl" : "tcp")."://".$this->cfg['host'].":".$this->cfg['port'];
}
After that you can initialize the client with:
$client = new JAXL(array(
'jid' => '<your-API-key>@gcm.googleapis.com',
'pass' => '<your-API-key>',
'host' => 'gcm.googleapis.com',
'port' => 5235,
'force_tls' => true,
'auth_type' => 'PLAIN',
'strict' => FALSE,
'ssl' => TRUE
));
Also, when you initialize the client, use
'log_level' => JAXL_DEBUG
That will allow you to see everything that's sending or being received. In my case, I figured out that my project has not yet been whitelisted - I forgot to register it on https://services.google.com/fb/forms/gcm/
jaxl_socket_client:189 - 2013-10-04 08:11:58 - <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><temporary-auth-failure/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">Project 1012343798740 not whitelisted.</text></failure>