Browse Source

remove ws

Michelle Bu 12 years ago
parent
commit
64d05c25c5
2 changed files with 6 additions and 6 deletions
  1. 2 2
      lib/peer.js
  2. 4 4
      lib/socket.js

+ 2 - 2
lib/peer.js

@@ -9,7 +9,7 @@ function Peer(id, options) {
   if (!(this instanceof Peer)) return new Peer(id, options);
   EventEmitter.call(this);
 
-  
+
   options = util.extend({
     debug: false,
     host: '0.peerjs.com',
@@ -35,7 +35,7 @@ function Peer(id, options) {
   if (options.host === '/') {
     options.host = window.location.hostname;
   }
-  
+
   // Ensure alphanumeric_-
   if (id && !/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.exec(id)) {
     util.setZeroTimeout(function() {

+ 4 - 4
lib/socket.js

@@ -5,12 +5,12 @@
 function Socket(host, port, key, id) {
   if (!(this instanceof Socket)) return new Socket(host, port, key, id);
   EventEmitter.call(this);
-  
+
   this._id = id;
   var token = util.randomToken();
 
   this.disconnected = false;
-  
+
   this._httpUrl = 'http://' + host + ':' + port + '/' + key + '/' + id + '/' + token;
   this._wsUrl = 'ws://' + host + ':' + port + '/peerjs?key='+key+'&id='+id+'&token='+token;
 };
@@ -34,7 +34,7 @@ Socket.prototype._startWebSocket = function() {
   }
 
   this._socket = new WebSocket(this._wsUrl);
-  
+
   this._socket.onmessage = function(event) {
     var data;
     try {
@@ -156,7 +156,7 @@ Socket.prototype.send = function(data) {
     this.emit('error', 'Invalid message');
     return;
   }
-  
+
   var message = JSON.stringify(data);
   if (this._wsOpen()) {
     this._socket.send(message);