I'm trying to connect to the Firebase Cloud Messaging Server (CCS) using xmpp protocol in Node.js. So far I was unsuccessful.
I'm using node-xmpp-client library and it gives me the following error:
{ [Error: connect ETIMEDOUT 64.233.191.188:5235]
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '64.233.191.188',
port: 5235 }
and here is my code:
var Client = require('node-xmpp-client');
var client = new Client({
jid: '<my sender id>@gcm.googleapis.com',
password: '<my server key>',
host: 'fcm-xmpp.googleapis.com',
port: 5235
});
client.connection.socket.on('error', function (error) {
console.log("socket error");
console.error(error);
process.exit(1);
});
client.on('online', function (data) {
console.log('Connected as ' + data.jid.local + '@' + data.jid.domain + '/' + data.jid.resource);
});
client.on('error', function (err) {
console.log("server error");
console.error(err);
process.exit(1);
});
jid
(gcm...) andhost
(fcm...). I think it should be same fcm? Can you try? – AL.jid
? Remove the@gcm.googleapis.com
? I think I remember a similar post, but I'm not entirely sure. – AL.