Home

clientmaxwindowbits

clientmaxwindowbits, more commonly written as client_max_window_bits, is a parameter used in the WebSocket permessage-deflate extension to negotiate the DEFLATE compression window size. It is part of the negotiation described in RFC 7692 and is conveyed by the client in the Sec-WebSocket-Extensions header when initiating a WebSocket connection.

The parameter indicates the desired base-2 logarithm of the LZ77 sliding window size that the client would

The chosen window size affects performance and resource usage. Larger window sizes can improve compression efficiency,

Security and compatibility considerations apply. Compression can introduce side-channel risks in some contexts, and not all

like
the
server
to
use
for
compression.
The
resulting
window
size
is
2^n
bytes,
with
n
typically
in
the
range
of
8
to
15.
A
value
may
be
provided
explicitly
by
the
client
(for
example,
requesting
a
particular
window
size)
or
omitted,
in
which
case
the
server
may
choose
a
default.
The
server
may
accept
the
request
or
override
it
with
its
own
choice,
which
it
signals
back
in
the
response
via
the
server_max_window_bits
parameter
if
applicable.
especially
for
long
or
repetitive
data
streams,
but
they
require
more
memory
and
processing
power.
Smaller
window
sizes
reduce
memory
usage
at
the
potential
cost
of
a
weaker
compression
ratio.
The
actual
window
size
used
becomes
part
of
the
negotiated
permessage-deflate
state
and
governs
subsequent
DEFLATE
operations
on
compressed
WebSocket
messages.
servers
or
intermediaries
support
permessage-deflate
or
honor
all
negotiations.
Therefore,
both
client
and
server
should
implement
robust
handling
and
provide
clear
fallbacks
when
negotiation
cannot
be
completed.