json stringify erros

This commit is contained in:
ericz 2013-02-13 00:42:47 -08:00
parent 0dcf44ded3
commit 7547f5f1ae

View File

@ -79,7 +79,7 @@ PeerServer.prototype._initializeWSS = function() {
socket.send(JSON.stringify({ type: 'OPEN' }));
self._configureWS(socket, key, id, token);
} else {
socket.send({ type: 'ERROR', payload: { msg: err } });
socket.send(JSON.stringify({ type: 'ERROR', payload: { msg: err } }));
}
});
} else {
@ -215,7 +215,7 @@ PeerServer.prototype._initializeHTTP = function() {
self._ips[ip]++;
self._startStreaming(res, key, id, token, true);
} else {
res.send({ type: 'ERROR', payload: { msg: err } });
res.send(JSON.stringify({ type: 'HTTP-ERROR' }));
}
});
} else {