Package org.mockserver.netty.unification
Class AltSvcHeaderHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.mockserver.netty.unification.AltSvcHeaderHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
@Sharable
public class AltSvcHeaderHandler
extends io.netty.channel.ChannelDuplexHandler
Outbound handler that adds an
Alt-Svc header to responses served
over the TCP (HTTP/1.1 and HTTP/2) paths when HTTP/3 is enabled.
The header advertises the HTTP/3 endpoint so HTTP/3-capable clients can auto-upgrade to QUIC on subsequent requests while falling back to HTTP/2 or HTTP/1.1 if QUIC is unavailable (RFC 7838).
The handler does NOT overwrite an alt-svc header that was
explicitly set by a user expectation.
This handler is ChannelHandler.Sharable because it keeps no
per-channel mutable state — the Alt-Svc header value is computed once
at construction time and is immutable.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
AltSvcHeaderHandler
public AltSvcHeaderHandler(int http3Port, long maxAgeSeconds) - Parameters:
http3Port- the UDP port on which the HTTP/3 (QUIC) server is listeningmaxAgeSeconds- thema(max-age) parameter in seconds
-
-
Method Details