Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

config/servers.json里的server配置支持clientHost属性 #935

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/components/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ var getConnector = function(app, opts) {
}

var curServer = app.getCurServer();
return connector(curServer.clientPort, curServer.host, opts);
var host = curServer.clientHost || curServer.host;
return connector(curServer.clientPort, host, opts);
};

var getDefaultConnector = function(app, opts) {
var DefaultConnector = require('../connectors/sioconnector');
var curServer = app.getCurServer();
return new DefaultConnector(curServer.clientPort, curServer.host, opts);
var host = curServer.clientHost || curServer.host;
return new DefaultConnector(curServer.clientPort, host, opts);
};

var hostFilter = function(cb, socket) {
Expand Down