Home / Function/ handleProxyProtocol() — netty Function Reference

handleProxyProtocol() — netty Function Reference

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

Function java Buffer Allocators calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  75bc00ad_fcbe_9a76_c277_9f5f07f68782["handleProxyProtocol()"]
  d0b975d2_7f64_c584_7cb3_d21e4c48f4c0["Socks4TerminalHandler"]
  75bc00ad_fcbe_9a76_c277_9f5f07f68782 -->|defined in| d0b975d2_7f64_c584_7cb3_d21e4c48f4c0
  a35fdca2_34a5_93ee_8df6_a105404d182a["handleProxyProtocol()"]
  a35fdca2_34a5_93ee_8df6_a105404d182a -->|calls| 75bc00ad_fcbe_9a76_c277_9f5f07f68782
  a35fdca2_34a5_93ee_8df6_a105404d182a["handleProxyProtocol()"]
  75bc00ad_fcbe_9a76_c277_9f5f07f68782 -->|calls| a35fdca2_34a5_93ee_8df6_a105404d182a
  90dc76b7_3a78_6df5_59e1_b00ba7bca997["authenticate()"]
  75bc00ad_fcbe_9a76_c277_9f5f07f68782 -->|calls| 90dc76b7_3a78_6df5_59e1_b00ba7bca997
  style 75bc00ad_fcbe_9a76_c277_9f5f07f68782 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler-proxy/src/test/java/io/netty/handler/proxy/Socks4ProxyServer.java lines 116–143

        @Override
        protected boolean handleProxyProtocol(ChannelHandlerContext ctx, Object msg) throws Exception {
            Socks4CommandRequest req = (Socks4CommandRequest) msg;
            boolean authzSuccess = authenticate(ctx, req);

            Socks4CommandResponse res;
            boolean sendGreeting = false;
            if (!authzSuccess) {
                res = new DefaultSocks4CommandResponse(Socks4CommandStatus.IDENTD_AUTH_FAILURE);
            } else if (!req.dstAddr().equals(destination.getHostString()) ||
                       req.dstPort() != destination.getPort()) {
                res = new DefaultSocks4CommandResponse(Socks4CommandStatus.REJECTED_OR_FAILED);
            } else {
                res = new DefaultSocks4CommandResponse(Socks4CommandStatus.SUCCESS);
                sendGreeting = true;
            }

            ctx.write(res);

            ctx.pipeline().remove(Socks4ServerDecoder.class);
            ctx.pipeline().remove(Socks4ServerEncoder.class);

            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/Socks4ProxyServer.java.
Where is handleProxyProtocol() defined?
handleProxyProtocol() is defined in handler-proxy/src/test/java/io/netty/handler/proxy/Socks4ProxyServer.java at line 116.
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