문제

I am using node-gcm to send push notifications to android. Whenever node runs behind a proxy, the gcm doesn't work anymore. How can I tell gcm to use the proxy?

var sender = new gcm.Sender('XXX');
var registrationIds = [];
registrationsIds.push('YYY');
message.addDataWithObject({
    message: 'New message! Tap to reply.',
    title: "Mew Message"
});
sender.send(message, registrationIds, 4, function (err, resultmsg) {
        console.log(resultmsg);
        ...
});

Thanks & Best, Marc

도움이 되었습니까?

해결책

After checking the lib I found a solution:

var sender = new gcm.Sender('XXX',{'proxy':'http://user:password@proxyserver:port'});

Where 'XXX' is your id and the second parameter an options-object.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top