ericz 12 жил өмнө
parent
commit
7547f5f1ae
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      lib/server.js

+ 2 - 2
lib/server.js

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