Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
e6500004
Commit
e6500004
authored
Apr 23, 2013
by
Joel Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #245 from wrouesnel/vnc-auto-fix
Detect port properly in vnc_auto.html when used on port 80 or 443.
parents
44ff8632
58873b32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
ui.js
include/ui.js
+13
-1
vnc_auto.html
vnc_auto.html
+11
-0
No files found.
include/ui.js
View file @
e6500004
...
...
@@ -55,9 +55,21 @@ start: function(callback) {
// call twice to get around webkit bug
WebUtil
.
selectStylesheet
(
UI
.
getSetting
(
'stylesheet'
));
// if port == 80 (or 443) then it won't be present and should be
// set manually
port
=
window
.
location
.
port
;
if
(
!
port
)
{
if
(
window
.
location
.
protocol
.
substring
(
0
,
4
)
==
'http'
)
{
port
=
80
;
}
else
if
(
window
.
location
.
protocol
.
substring
(
0
,
5
)
==
'https'
)
{
port
=
443
;
}
}
/* Populate the controls if defaults are provided in the URL */
UI
.
initSetting
(
'host'
,
window
.
location
.
hostname
);
UI
.
initSetting
(
'port'
,
window
.
location
.
port
);
UI
.
initSetting
(
'port'
,
port
);
UI
.
initSetting
(
'password'
,
''
);
UI
.
initSetting
(
'encrypt'
,
(
window
.
location
.
protocol
===
"https:"
));
UI
.
initSetting
(
'true_color'
,
true
);
...
...
vnc_auto.html
View file @
e6500004
...
...
@@ -122,6 +122,17 @@
host
=
WebUtil
.
getQueryVar
(
'host'
,
window
.
location
.
hostname
);
port
=
WebUtil
.
getQueryVar
(
'port'
,
window
.
location
.
port
);
// if port == 80 (or 443) then it won't be present and should be
// set manually
if
(
!
port
)
{
if
(
window
.
location
.
protocol
.
substring
(
0
,
4
)
==
'http'
)
{
port
=
80
;
}
else
if
(
window
.
location
.
protocol
.
substring
(
0
,
5
)
==
'https'
)
{
port
=
443
;
}
}
// If a token variable is passed in, set the parameter in a cookie.
// This is used by nova-novncproxy.
token
=
WebUtil
.
getQueryVar
(
'token'
,
null
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment