mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Fixed websocket uri
This commit is contained in:
@@ -110,15 +110,14 @@ WS.prototype.doClose = function () {
|
||||
*/
|
||||
|
||||
WS.prototype.uri = function () {
|
||||
var opts = this.options
|
||||
, query = util.qs(opts.query)
|
||||
, schema = opts.secure ? 'wss' : 'ws'
|
||||
var query = util.qs(this.query)
|
||||
, schema = this.secure ? 'wss' : 'ws'
|
||||
, port = ''
|
||||
|
||||
// avoid port if default for schema
|
||||
if (('wss' == schema && opts.port != 443)
|
||||
|| ('ws' == schema && opts.port != 80)) {
|
||||
port = ':' + opts.port;
|
||||
if (this.port && (('wss' == schema && this.port != 443)
|
||||
|| ('ws' == schema && this.port != 80))) {
|
||||
port = ':' + this.port;
|
||||
}
|
||||
|
||||
// prepend ? to query
|
||||
@@ -126,7 +125,7 @@ WS.prototype.uri = function () {
|
||||
query = '?' + query;
|
||||
}
|
||||
|
||||
return schema + opts.host + port + opts.path + query;
|
||||
return schema + '://' + this.host + port + this.path + query;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user