Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
c4d6e4bb
Commit
c4d6e4bb
authored
Jul 17, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spiceproxy: use tcp instead of unix socket
parent
a1f1b60c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
HTTPServer.pm
PVE/HTTPServer.pm
+10
-9
No files found.
PVE/HTTPServer.pm
View file @
c4d6e4bb
...
...
@@ -480,7 +480,7 @@ sub handle_api2_request {
}
sub
handle_spice_proxy_request
{
my
(
$self
,
$reqstate
,
$vmid
,
$node
)
=
@_
;
my
(
$self
,
$reqstate
,
$vmid
,
$node
,
$spiceport
)
=
@_
;
eval
{
...
...
@@ -500,16 +500,17 @@ sub handle_spice_proxy_request {
$reqstate
->
{
hdl
}
->
timeout
(
0
);
# local node
my
$socket
=
PVE::QemuServer::
spice_socket
(
$vmid
);
print
"
$$: CONNECT
$vmid
,
$node
,
$socket
\n
"
if
$self
->
{
debug
};
print
"
$$: CONNECT
$vmid
,
$node
,
$spiceport
\n
"
if
$self
->
{
debug
};
# fixme: use qmp add_client instead?
# fixme: this needs root privs
tcp_connect
"
unix/
",
$socke
t
,
sub
{
tcp_connect
"
127.0.0.1
",
$spicepor
t
,
sub
{
my
(
$fh
)
=
@_
or
die
"
connect to '
$socke
t
' failed: $!
";
or
die
"
connect to '
localhost:
$spicepor
t
' failed: $!
";
print
"
$$: CONNECTed to
$socke
t
\n
"
if
$self
->
{
debug
};
print
"
$$: CONNECTed to
localhost:
$spicepor
t
\n
"
if
$self
->
{
debug
};
$reqstate
->
{
proxyhdl
}
=
AnyEvent::
Handle
->
new
(
fh
=>
$fh
,
rbuf_max
=>
64
*
1024
,
...
...
@@ -851,12 +852,12 @@ sub unshift_read_header {
my
$auth
=
{};
if
(
$self
->
{
spiceproxy
})
{
my
$connect_str
=
$r
->
header
('
Host
');
my
(
$vmid
,
$node
)
=
PVE::AccessControl::
verify_spice_connect_url
(
$connect_str
);
if
(
!
(
$vmid
&&
$node
))
{
my
(
$vmid
,
$node
,
$port
)
=
PVE::AccessControl::
verify_spice_connect_url
(
$connect_str
);
if
(
!
(
$vmid
&&
$node
&&
$port
))
{
$self
->
error
(
$reqstate
,
HTTP_UNAUTHORIZED
,
"
invalid ticket
");
return
;
}
$self
->
handle_spice_proxy_request
(
$reqstate
,
$vmid
,
$node
);
$self
->
handle_spice_proxy_request
(
$reqstate
,
$vmid
,
$node
,
$port
);
return
;
}
elsif
(
$path
=~
m!$baseuri!
)
{
my
$token
=
$r
->
header
('
CSRFPreventionToken
');
...
...
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