Interface ProxyInformation


  • @DoNotImplement
    public interface ProxyInformation
    This class encapsulates all information that is forwarded by a load balancer which uses the PROXY protocol. Except from the source connection information and the load balancer information, most of the values are optional.

    HiveMQ supports arbitrary TLVs which can be retrieved as raw TLV values (see getRawTLVs())

    Since:
    4.0.0, CE 2019.1
    • Method Detail

      • getSourcePort

        int getSourcePort()
        Returns:
        The original source port of the MQTT client.
        Since:
        4.0.0, CE 2019.1
      • getSourceAddress

        @NotNull InetAddress getSourceAddress()
        Returns:
        The original source address of the MQTT client.
        Since:
        4.0.0, CE 2019.1
      • getProxyPort

        int getProxyPort()
        Returns:
        The port of the load balancer that is used to proxy the client connection.
        Since:
        4.0.0, CE 2019.1
      • getProxyAddress

        @NotNull InetAddress getProxyAddress()
        Returns:
        The address of the load balancer that is used to proxy the client connection.
        Since:
        4.0.0, CE 2019.1
      • getTlsVersion

        @NotNull Optional<String> getTlsVersion()
        If the PROXY protocol implementation of the load balancer supports TLVs and proxies a SSL connection, this method returns the TLS version of the original SSL connection.
        Returns:
        An Optional that contains the original TLS version if supported by the load balancer.
        Since:
        4.0.0, CE 2019.1
      • getSslCertificateCN

        @NotNull Optional<String> getSslCertificateCN()
        If the PROXY protocol implementation of the load balancer supports TLVs and proxies a SSL connection with a X509 client certificate that is sent by the MQTT client, this method returns the forwarded common name of the X509 client certificate (if the client used one to authenticate the SSL connection).
        Returns:
        An Optional that contains the Common Name of the X509 client certificate.
        Since:
        4.0.0, CE 2019.1
      • getRawTLVs

        @NotNull Map<Byte,​@Immutable ByteBuffer> getRawTLVs()
        HiveMQ supports arbitrary TLVs, even TLVs that aren't specified by the PROXY protocol. This map contains all the raw TLVs that are sent by the load balancer.

        The key is the byte value of the TLV type and the value is the raw TLV as byte value.

        The ByteBuffers returned by this method are read only and will throw a ReadOnlyBufferException if handled incorrectly.

        Returns:
        A Map with raw TLVs.
        Since:
        4.0.0, CE 2019.1