Home / Function/ handleHttpRequest() — netty Function Reference

handleHttpRequest() — netty Function Reference

Architecture documentation for the handleHttpRequest() function in AutobahnServerHandler.java from the netty codebase.

Function java Buffer Telemetry calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  9582854a_5889_5658_7efd_36d66fcb998f["handleHttpRequest()"]
  ae745e27_4df1_b3ea_fa42_b6885b919f66["AutobahnServerHandler"]
  9582854a_5889_5658_7efd_36d66fcb998f -->|defined in| ae745e27_4df1_b3ea_fa42_b6885b919f66
  b028e31f_a8e1_153c_dee2_72c016dcbcdb["channelRead()"]
  b028e31f_a8e1_153c_dee2_72c016dcbcdb -->|calls| 9582854a_5889_5658_7efd_36d66fcb998f
  ae872491_ad06_d7be_5add_fde8a3b97c5f["sendHttpResponse()"]
  9582854a_5889_5658_7efd_36d66fcb998f -->|calls| ae872491_ad06_d7be_5add_fde8a3b97c5f
  style 9582854a_5889_5658_7efd_36d66fcb998f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java lines 72–95

    private void handleHttpRequest(ChannelHandlerContext ctx, HttpRequest req)
            throws Exception {
        // Handle a bad request.
        if (!req.decoderResult().isSuccess()) {
            sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST, ctx.alloc().buffer(0)));
            return;
        }

        // Allow only GET methods.
        if (!GET.equals(req.method())) {
            sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN, ctx.alloc().buffer(0)));
            return;
        }

        // Handshake
        WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(
                getWebSocketLocation(req), null, false, Integer.MAX_VALUE);
        handshaker = wsFactory.newHandshaker(req);
        if (handshaker == null) {
            WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel());
        } else {
            handshaker.handshake(ctx.channel(), req);
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does handleHttpRequest() do?
handleHttpRequest() is a function in the netty codebase, defined in testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java.
Where is handleHttpRequest() defined?
handleHttpRequest() is defined in testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java at line 72.
What does handleHttpRequest() call?
handleHttpRequest() calls 1 function(s): sendHttpResponse.
What calls handleHttpRequest()?
handleHttpRequest() is called by 1 function(s): channelRead.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free