mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-05-28 10:18:00 +00:00
websocket_proxy: implement ping/pong support
needed to keep tunnel connections alive. > The Ping frame contains an opcode of 0x9. > [...] > The Pong frame contains an opcode of 0xA. -- Section 5.5.2 cf. https://tools.ietf.org/html/rfc6455#section-5.5.2 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c3bd22ec46
commit
e6cb79b52c
@ -511,6 +511,11 @@ sub websocket_proxy {
|
||||
$reqstate->{proxyhdl}->push_shutdown();
|
||||
}
|
||||
$hdl->push_shutdown();
|
||||
} elsif ($opcode == 9) {
|
||||
# ping received, schedule pong
|
||||
$reqstate->{hdl}->push_write($encode->(\$payload, "\x8A")) if $reqstate->{hdl};
|
||||
} elsif ($opcode == 0xA) {
|
||||
# pong received, continue
|
||||
} else {
|
||||
die "received unhandled websocket opcode $opcode\n";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user