[pve-devel] applied: [PATCH http-server 3/4] websocket_proxy: implement ping/pong support
Thomas Lamprecht
t.lamprecht at proxmox.com
Sat Mar 7 20:27:28 CET 2020
On 3/6/20 11:20 AM, Fabian Grünbichler wrote:
> needed to keep tunnel connections alive.
>
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
> PVE/APIServer/AnyEvent.pm | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/PVE/APIServer/AnyEvent.pm b/PVE/APIServer/AnyEvent.pm
> index 7147d81..bc2ec4d 100644
> --- a/PVE/APIServer/AnyEvent.pm
> +++ b/PVE/APIServer/AnyEvent.pm
> @@ -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";
> }
>
applied, added some context about where this comes from in the
commit message, i.e., a link to the RFC :)
More information about the pve-devel
mailing list