Transport fixes
This commit is contained in:
parent
0f2a21c134
commit
cb917c6bda
|
@ -1 +0,0 @@
|
|||
throw new Error("TCP transport is not supported by Browser platform");
|
|
@ -268,7 +268,9 @@ TcpTransport.prototype.listen = function() {
|
|||
client.on("close", function() {
|
||||
delete self._clients[id];
|
||||
});
|
||||
var transport = new self.constructor(self);
|
||||
var opts = objectAssign({}, self);
|
||||
delete opts._server;
|
||||
var transport = new self.constructor(opts);
|
||||
var incoming = true;
|
||||
transport._setupClient(client, incoming);
|
||||
var addr = client.remoteAddress;
|
||||
|
|
|
@ -180,7 +180,9 @@ WsTransport.prototype.listen = function(options, callback) {
|
|||
var server = self._server = new WebSocketServer(options, callback);
|
||||
|
||||
server.on("connection", function(client) {
|
||||
var transport = new self.constructor(self);
|
||||
var opts = objectAssign({}, self);
|
||||
delete opts._server;
|
||||
var transport = new self.constructor(opts);
|
||||
var incoming = true;
|
||||
transport._setupClient(client, incoming);
|
||||
transport._handleTimeout();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"main": "./lib/index.js",
|
||||
"browser": {
|
||||
"./lib/platform.js": "./lib/platform.browser.js",
|
||||
"./lib/net/tcp.js": "./lib/net/tcp.browser.js",
|
||||
"./lib/net/tcp.js": false,
|
||||
"./lib/net/ws.js": "./lib/net/ws.browser.js"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user