Home / Function/ CharSequence() — netty Function Reference

CharSequence() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  abae57a5_caca_dba0_3ced_89a7c352b8c2["CharSequence()"]
  c066c80e_6ce3_75b8_2f7f_b6e3991df91b["WebSocketClientHandshaker"]
  abae57a5_caca_dba0_3ced_89a7c352b8c2 -->|defined in| c066c80e_6ce3_75b8_2f7f_b6e3991df91b
  style abae57a5_caca_dba0_3ced_89a7c352b8c2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java lines 721–742

    static CharSequence websocketHostValue(URI wsURL) {
        int port = wsURL.getPort();
        if (port == -1) {
            return wsURL.getHost();
        }
        String host = wsURL.getHost();
        String scheme = wsURL.getScheme();
        if (port == HttpScheme.HTTP.port()) {
            return HttpScheme.HTTP.name().contentEquals(scheme)
                    || WebSocketScheme.WS.name().contentEquals(scheme) ?
                    host : NetUtil.toSocketAddressString(host, port);
        }
        if (port == HttpScheme.HTTPS.port()) {
            return HttpScheme.HTTPS.name().contentEquals(scheme)
                    || WebSocketScheme.WSS.name().contentEquals(scheme) ?
                    host : NetUtil.toSocketAddressString(host, port);
        }

        // if the port is not standard (80/443) its needed to add the port to the header.
        // See https://tools.ietf.org/html/rfc6454#section-6.2
        return NetUtil.toSocketAddressString(host, port);
    }

Subdomains

Frequently Asked Questions

What does CharSequence() do?
CharSequence() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java.
Where is CharSequence() defined?
CharSequence() is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientHandshaker.java at line 721.

Analyze Your Own Codebase

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

Try Supermodel Free