Fix #324
Added support for string hosts in ConnectionAbstract constructor. Host constructor is used with supplied host string to create host object for ConnectionAbstract.
This commit is contained in:
@ -22,6 +22,8 @@ function ConnectionAbstract(host, config) {
|
||||
throw new TypeError('Missing host');
|
||||
} else if (host instanceof Host) {
|
||||
this.host = host;
|
||||
} else if (typeof host === "string"){
|
||||
this.host = new Host(host);
|
||||
} else {
|
||||
throw new TypeError('Invalid host');
|
||||
}
|
||||
@ -96,4 +98,4 @@ ConnectionAbstract.prototype.setStatus = function (status) {
|
||||
if (status === 'closed') {
|
||||
this.removeAllListeners();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user