private HttpResponse failOrFallback(ServiceRequestContext ctx, HttpRequest req,
                                        Supplier<HttpResponse> invalidResponse) throws Exception {
        if (fallbackService != null) {
            // Try to apply ServiceOptions from fallbackService first. If not set, use the settings of the
            // virtual host.
            final ServiceOptions options = fallbackService.options();
            long requestTimeoutMillis = options.requestTimeoutMillis();
            if (requestTimeoutMillis < 0) {
                requestTimeoutMillis = ctx.config().virtualHost().requestTimeoutMillis();
            }
            ctx.setRequestTimeoutMillis(TimeoutMode.SET_FROM_START, requestTimeoutMillis);

            long maxRequestLength = options.maxRequestLength();
            if (maxRequestLength < 0) {
                maxRequestLength = ctx.config().virtualHost().maxRequestLength();
            }
            ctx.setMaxRequestLength(maxRequestLength);

            long requestAutoAbortDelayMillis = options.requestAutoAbortDelayMillis();
            if (requestAutoAbortDelayMillis < 0) {
                requestAutoAbortDelayMillis = ctx.config().virtualHost().requestAutoAbortDelayMillis();
            }
            ctx.setRequestAutoAbortDelayMillis(requestAutoAbortDelayMillis);

            return fallbackService.serve(ctx, req);
        } else {
            return invalidResponse.get();
        }
    }
Handles the HTTP/1.1 web socket handshake described in
<a href="https://datatracker.ietf.org/doc/html/rfc6455">The WebSocket Protocol</a>.
These are examples of a request and its corresponding response:

<p>Request:
<pre>
GET /chat HTTP/1.1
Host: server.example.com
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: http://example.com
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13
</pre>

<p>Response:
<pre>
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=
Sec-WebSocket-Protocol: chat
</pre>
core/src/main/java/com/linecorp/armeria/internal/server/websocket/DefaultWebSocketService.java