Commit 51c089e8 by Jeffrey Phillips

Use web socket protocol for ws requests when server block specifies protocol

parent 62b15616
......@@ -2206,13 +2206,14 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
return null;
}
var serviceProtocol = apiInfo.protocol || window.location.protocol;
var protocol;
params = params || {};
if (isWebsocket) {
protocol = window.location.protocol === "http:" ? "ws" : "wss";
protocol = serviceProtocol === "http:" ? "ws" : "wss";
}
else {
protocol = window.location.protocol === "http:" ? "http" : "https";
protocol = serviceProtocol === "http:" ? "http" : "https";
}
if (context && context.namespace && !params.namespace) {
......@@ -2233,7 +2234,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
}
var template;
var templateOptions = {
protocol: apiInfo.protocol || protocol,
protocol: protocol,
hostPort: apiInfo.hostPort,
prefix: apiInfo.prefix,
group: apiInfo.group,
......
......@@ -3415,13 +3415,14 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
return null;
}
var serviceProtocol = apiInfo.protocol || window.location.protocol;
var protocol;
params = params || {};
if (isWebsocket) {
protocol = window.location.protocol === "http:" ? "ws" : "wss";
protocol = serviceProtocol === "http:" ? "ws" : "wss";
}
else {
protocol = window.location.protocol === "http:" ? "http" : "https";
protocol = serviceProtocol === "http:" ? "http" : "https";
}
if (context && context.namespace && !params.namespace) {
......@@ -3442,7 +3443,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
}
var template;
var templateOptions = {
protocol: apiInfo.protocol || protocol,
protocol: protocol,
hostPort: apiInfo.hostPort,
prefix: apiInfo.prefix,
group: apiInfo.group,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1210,13 +1210,14 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
return null;
}
var serviceProtocol = apiInfo.protocol || window.location.protocol;
var protocol;
params = params || {};
if (isWebsocket) {
protocol = window.location.protocol === "http:" ? "ws" : "wss";
protocol = serviceProtocol === "http:" ? "ws" : "wss";
}
else {
protocol = window.location.protocol === "http:" ? "http" : "https";
protocol = serviceProtocol === "http:" ? "http" : "https";
}
if (context && context.namespace && !params.namespace) {
......@@ -1237,7 +1238,7 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
}
var template;
var templateOptions = {
protocol: apiInfo.protocol || protocol,
protocol: protocol,
hostPort: apiInfo.hostPort,
prefix: apiInfo.prefix,
group: apiInfo.group,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment