无法使用node-gcm

时间:2015-07-23 13:08:29

标签: android node.js push-notification google-cloud-messaging

我需要从节点推送GCM,我使用node-gcm,但是我收到了ENOTFOUND错误

var gcm = require('node-gcm');
var gcmMessage = new gcm.Message({
    collapseKey: 'notify',
    delayWhileIdle: false,
    timeToLive: 3600,
    data: {
       title: "Hai",
       message: "Message",
    }
});
var gcmIds = ['<myid>'];

var sender = new gcm.Sender('<mysender id>',{'proxy':'<proxyip>:8080'});
sender.send(gcmMessage, gcmIds, 4, function(err, ret){
    console.log('>>> sendGcm: ', err, ret);
});

我收到错误

sendGcm:  { [Error: tunneling socket could not be established, cause=getaddr
info ENOTFOUND] code: 'ECONNRESET' } null

0 个答案:

没有答案