Home / Function/ DefaultSocks5CommandRequest() — netty Function Reference

DefaultSocks5CommandRequest() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  185f967c_c2cc_1c0e_a312_00f501bd236e["DefaultSocks5CommandRequest()"]
  2b361ef3_2470_46a0_14c7_5152a29224a6["DefaultSocks5CommandRequest"]
  185f967c_c2cc_1c0e_a312_00f501bd236e -->|defined in| 2b361ef3_2470_46a0_14c7_5152a29224a6
  style 185f967c_c2cc_1c0e_a312_00f501bd236e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/DefaultSocks5CommandRequest.java lines 35–64

    public DefaultSocks5CommandRequest(
            Socks5CommandType type, Socks5AddressType dstAddrType, String dstAddr, int dstPort) {

        this.type = ObjectUtil.checkNotNull(type, "type");
        ObjectUtil.checkNotNull(dstAddrType, "dstAddrType");
        ObjectUtil.checkNotNull(dstAddr, "dstAddr");

        if (dstAddrType == Socks5AddressType.IPv4) {
            if (!NetUtil.isValidIpV4Address(dstAddr)) {
                throw new IllegalArgumentException("dstAddr: " + dstAddr + " (expected: a valid IPv4 address)");
            }
        } else if (dstAddrType == Socks5AddressType.DOMAIN) {
            dstAddr = IDN.toASCII(dstAddr);
            if (dstAddr.length() > 255) {
                throw new IllegalArgumentException("dstAddr: " + dstAddr + " (expected: less than 256 chars)");
            }
        } else if (dstAddrType == Socks5AddressType.IPv6) {
            if (!NetUtil.isValidIpV6Address(dstAddr)) {
                throw new IllegalArgumentException("dstAddr: " + dstAddr + " (expected: a valid IPv6 address");
            }
        }

        if (dstPort < 0 || dstPort > 65535) {
            throw new IllegalArgumentException("dstPort: " + dstPort + " (expected: 0~65535)");
        }

        this.dstAddrType = dstAddrType;
        this.dstAddr = dstAddr;
        this.dstPort = dstPort;
    }

Domain

Subdomains

Frequently Asked Questions

What does DefaultSocks5CommandRequest() do?
DefaultSocks5CommandRequest() is a function in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/DefaultSocks5CommandRequest.java.
Where is DefaultSocks5CommandRequest() defined?
DefaultSocks5CommandRequest() is defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/DefaultSocks5CommandRequest.java at line 35.

Analyze Your Own Codebase

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

Try Supermodel Free