mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-05-30 11:52:43 +00:00
AnyEvent/websocket_proxy: remove 'base64' handling
novnc does not support this anymore since 2015, and neither does our xtermjs client. it is also not listed in IANAs list of websocket protocols [0]. so simply drop it and only send out binary frames and don't decode text frames 0: https://www.iana.org/assignments/websocket/websocket.xml#subprotocol-name Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
f8f97c8d26
commit
015964a341
@ -496,15 +496,6 @@ sub websocket_proxy {
|
|||||||
|
|
||||||
my $max_payload_size = 128*1024;
|
my $max_payload_size = 128*1024;
|
||||||
|
|
||||||
my $binary;
|
|
||||||
if ($wsproto eq 'binary') {
|
|
||||||
$binary = 1;
|
|
||||||
} elsif ($wsproto eq 'base64') {
|
|
||||||
$binary = 0;
|
|
||||||
} else {
|
|
||||||
die "websocket_proxy: unsupported protocol '$wsproto'\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($param->{port}) {
|
if ($param->{port}) {
|
||||||
$remhost = 'localhost';
|
$remhost = 'localhost';
|
||||||
$remport = $param->{port};
|
$remport = $param->{port};
|
||||||
@ -520,13 +511,9 @@ sub websocket_proxy {
|
|||||||
|
|
||||||
my $string;
|
my $string;
|
||||||
my $payload;
|
my $payload;
|
||||||
if ($binary) {
|
|
||||||
$string = $opcode ? $opcode : "\x82"; # binary frame
|
$string = $opcode ? $opcode : "\x82"; # binary frame
|
||||||
$payload = $$data;
|
$payload = $$data;
|
||||||
} else {
|
|
||||||
$string = $opcode ? $opcode : "\x81"; # text frame
|
|
||||||
$payload = encode_base64($$data, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $payload_len = length($payload);
|
my $payload_len = length($payload);
|
||||||
if ($payload_len <= 125) {
|
if ($payload_len <= 125) {
|
||||||
@ -635,8 +622,6 @@ sub websocket_proxy {
|
|||||||
$payload ^= $mask;
|
$payload ^= $mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
$payload = decode_base64($payload) if !$binary;
|
|
||||||
|
|
||||||
if ($opcode == 1 || $opcode == 2) {
|
if ($opcode == 1 || $opcode == 2) {
|
||||||
$reqstate->{proxyhdl}->push_write($payload) if $reqstate->{proxyhdl};
|
$reqstate->{proxyhdl}->push_write($payload) if $reqstate->{proxyhdl};
|
||||||
} elsif ($opcode == 8) {
|
} elsif ($opcode == 8) {
|
||||||
|
Loading…
Reference in New Issue
Block a user