Home / Type/ SocksVersion Type — netty Architecture

SocksVersion Type — netty Architecture

Architecture documentation for the SocksVersion type/interface in SocksVersion.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e66bf5d9_05e0_8585_720a_89a4a0c9a5b1["SocksVersion"]
  9120a682_bc54_a0a7_836b_1c763e0499b1["SocksVersion.java"]
  e66bf5d9_05e0_8585_720a_89a4a0c9a5b1 -->|defined in| 9120a682_bc54_a0a7_836b_1c763e0499b1
  style e66bf5d9_05e0_8585_720a_89a4a0c9a5b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-socks/src/main/java/io/netty/handler/codec/socksx/SocksVersion.java lines 22–64

public enum SocksVersion {
    /**
     * SOCKS protocol version 4a (or 4)
     */
    SOCKS4a((byte) 0x04),
    /**
     * SOCKS protocol version 5
     */
    SOCKS5((byte) 0x05),
    /**
     * Unknown protocol version
     */
    UNKNOWN((byte) 0xff);

    /**
     * Returns the {@link SocksVersion} that corresponds to the specified version field value,
     * as defined in the protocol specification.
     *
     * @return {@link #UNKNOWN} if the specified value does not represent a known SOCKS protocol version
     */
    public static SocksVersion valueOf(byte b) {
        if (b == SOCKS4a.byteValue()) {
            return SOCKS4a;
        }
        if (b == SOCKS5.byteValue()) {
            return SOCKS5;
        }
        return UNKNOWN;
    }

    private final byte b;

    SocksVersion(byte b) {
        this.b = b;
    }

    /**
     * Returns the value of the version field, as defined in the protocol specification.
     */
    public byte byteValue() {
        return b;
    }
}

Frequently Asked Questions

What is the SocksVersion type?
SocksVersion is a type/interface in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/SocksVersion.java.
Where is SocksVersion defined?
SocksVersion is defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/SocksVersion.java at line 22.

Analyze Your Own Codebase

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

Try Supermodel Free