LSP: make preview respect protocol.pubaddr
This allows the preview to work even when behind sophisticated reverse- proxy setups and whatnot
This commit is contained in:
parent
bd1736c7e2
commit
1f9d5d6197
1 changed files with 14 additions and 3 deletions
15
lsp/mist.js
15
lsp/mist.js
|
@ -4016,15 +4016,26 @@ var UI = {
|
|||
|
||||
if (other == '') { UI.navto('Streams'); }
|
||||
|
||||
var parsed = parseURL(mist.user.host);
|
||||
var http_protocol = parsed.protocol;
|
||||
var http_host = parsed.host;
|
||||
var http_port = ':8080';
|
||||
for (var i in mist.data.config.protocols) {
|
||||
var protocol = mist.data.config.protocols[i];
|
||||
if ((protocol.connector == 'HTTP') || (protocol.connector == 'HTTP.exe')) {
|
||||
if (protocol.pubaddr) {
|
||||
var pub_parsed = parseURL(protocol.pubaddr);
|
||||
http_protocol = pub_parsed.protocol;
|
||||
http_host = pub_parsed.host;
|
||||
http_port = pub_parsed.port;
|
||||
}
|
||||
else {
|
||||
http_port = (protocol.port ? ':'+protocol.port : ':8080');
|
||||
}
|
||||
}
|
||||
var parsed = parseURL(mist.user.host);
|
||||
var embedbase = parsed.protocol+parsed.host+http_port+'/';
|
||||
}
|
||||
|
||||
var embedbase = http_protocol+http_host+http_port+'/';
|
||||
|
||||
var $cont = $('<div>').css({
|
||||
'display':'flex',
|
||||
|
|
Loading…
Add table
Reference in a new issue