Home / Function/ handleProxyProtocol() — netty Function Reference

handleProxyProtocol() — netty Function Reference

Architecture documentation for the handleProxyProtocol() function in HttpProxyServer.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  0b96569d_afe9_bbb8_48b0_efef32f1bdac["handleProxyProtocol()"]
  3655a06c_23a0_32d8_e5e3_92db919bce97["HttpTerminalHandler"]
  0b96569d_afe9_bbb8_48b0_efef32f1bdac -->|defined in| 3655a06c_23a0_32d8_e5e3_92db919bce97
  91005a3a_7b43_4ee7_4384_456793529f8a["handleProxyProtocol()"]
  91005a3a_7b43_4ee7_4384_456793529f8a -->|calls| 0b96569d_afe9_bbb8_48b0_efef32f1bdac
  91005a3a_7b43_4ee7_4384_456793529f8a["handleProxyProtocol()"]
  0b96569d_afe9_bbb8_48b0_efef32f1bdac -->|calls| 91005a3a_7b43_4ee7_4384_456793529f8a
  53be49a0_9a3d_011c_81ec_41cafe0e8353["authenticate()"]
  0b96569d_afe9_bbb8_48b0_efef32f1bdac -->|calls| 53be49a0_9a3d_011c_81ec_41cafe0e8353
  style 0b96569d_afe9_bbb8_48b0_efef32f1bdac fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler-proxy/src/test/java/io/netty/handler/proxy/HttpProxyServer.java lines 140–165

        @Override
        protected boolean handleProxyProtocol(ChannelHandlerContext ctx, Object msg) throws Exception {
            FullHttpRequest req = (FullHttpRequest) msg;
            FullHttpResponse res;
            boolean sendGreeting = false;

            if (!authenticate(ctx, req)) {
                res = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.UNAUTHORIZED);
                res.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
            } else if (!req.uri().equals(destination.getHostString() + ':' + destination.getPort())) {
                res = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.FORBIDDEN);
                res.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
            } else {
                res = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK);
                sendGreeting = true;
            }

            ctx.write(res);
            ctx.pipeline().get(HttpServerCodec.class).removeOutboundHandler();

            if (sendGreeting) {
                ctx.write(Unpooled.copiedBuffer("0\n", CharsetUtil.US_ASCII));
            }

            return true;
        }

Domain

Subdomains

Frequently Asked Questions

What does handleProxyProtocol() do?
handleProxyProtocol() is a function in the netty codebase, defined in handler-proxy/src/test/java/io/netty/handler/proxy/HttpProxyServer.java.
Where is handleProxyProtocol() defined?
handleProxyProtocol() is defined in handler-proxy/src/test/java/io/netty/handler/proxy/HttpProxyServer.java at line 140.
What does handleProxyProtocol() call?
handleProxyProtocol() calls 2 function(s): authenticate, handleProxyProtocol.
What calls handleProxyProtocol()?
handleProxyProtocol() is called by 1 function(s): handleProxyProtocol.

Analyze Your Own Codebase

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

Try Supermodel Free