Home / Function/ sendConnectCommand() — netty Function Reference

sendConnectCommand() — netty Function Reference

Architecture documentation for the sendConnectCommand() function in Socks5ProxyHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ab6a5019_0df9_7148_fbe1_714574730408["sendConnectCommand()"]
  926eac21_d91e_6616_387b_ad05731b49a5["Socks5ProxyHandler"]
  ab6a5019_0df9_7148_fbe1_714574730408 -->|defined in| 926eac21_d91e_6616_387b_ad05731b49a5
  c0259981_07c5_5878_5f82_f3d8674742ec["handleResponse()"]
  c0259981_07c5_5878_5f82_f3d8674742ec -->|calls| ab6a5019_0df9_7148_fbe1_714574730408
  style ab6a5019_0df9_7148_fbe1_714574730408 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler-proxy/src/main/java/io/netty/handler/proxy/Socks5ProxyHandler.java lines 256–277

    private void sendConnectCommand(ChannelHandlerContext ctx) throws Exception {
        InetSocketAddress raddr = destinationAddress();
        Socks5AddressType addrType;
        String rhost;
        if (raddr.isUnresolved()) {
            addrType = Socks5AddressType.DOMAIN;
            rhost = raddr.getHostString();
        } else {
            rhost = raddr.getAddress().getHostAddress();
            if (NetUtil.isValidIpV4Address(rhost)) {
                addrType = Socks5AddressType.IPv4;
            } else if (NetUtil.isValidIpV6Address(rhost)) {
                addrType = Socks5AddressType.IPv6;
            } else {
                throw new ProxyConnectException(
                        exceptionMessage("unknown address type: " + StringUtil.simpleClassName(rhost)));
            }
        }

        ctx.pipeline().replace(decoderName, decoderName, new Socks5CommandResponseDecoder());
        sendToProxyServer(new DefaultSocks5CommandRequest(Socks5CommandType.CONNECT, addrType, rhost, raddr.getPort()));
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does sendConnectCommand() do?
sendConnectCommand() is a function in the netty codebase, defined in handler-proxy/src/main/java/io/netty/handler/proxy/Socks5ProxyHandler.java.
Where is sendConnectCommand() defined?
sendConnectCommand() is defined in handler-proxy/src/main/java/io/netty/handler/proxy/Socks5ProxyHandler.java at line 256.
What calls sendConnectCommand()?
sendConnectCommand() is called by 1 function(s): handleResponse.

Analyze Your Own Codebase

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

Try Supermodel Free