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() {
|
client.on("close", function() {
|
||||||
delete self._clients[id];
|
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;
|
var incoming = true;
|
||||||
transport._setupClient(client, incoming);
|
transport._setupClient(client, incoming);
|
||||||
var addr = client.remoteAddress;
|
var addr = client.remoteAddress;
|
||||||
|
|
|
@ -180,7 +180,9 @@ WsTransport.prototype.listen = function(options, callback) {
|
||||||
var server = self._server = new WebSocketServer(options, callback);
|
var server = self._server = new WebSocketServer(options, callback);
|
||||||
|
|
||||||
server.on("connection", function(client) {
|
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;
|
var incoming = true;
|
||||||
transport._setupClient(client, incoming);
|
transport._setupClient(client, incoming);
|
||||||
transport._handleTimeout();
|
transport._handleTimeout();
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"browser": {
|
"browser": {
|
||||||
"./lib/platform.js": "./lib/platform.browser.js",
|
"./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"
|
"./lib/net/ws.js": "./lib/net/ws.browser.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user