Listener Types
HiveMQ Community Edition supports four types of listeners:- TCP Listener - Standard MQTT over TCP
- TLS TCP Listener - MQTT over TCP with TLS/SSL encryption
- WebSocket Listener - MQTT over WebSockets
- TLS WebSocket Listener - MQTT over WebSockets with TLS/SSL encryption
TCP Listener
The basic TCP listener for unencrypted MQTT connections.Configuration
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
port | Integer (0-65535) | Yes | - | The port to listen on |
bind-address | String | No | 0.0.0.0 | The IP address to bind to |
name | String | No | - | A descriptive name for the listener |
TLS TCP Listener
TCP listener with TLS/SSL encryption for secure MQTT connections.Configuration
TLS Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
keystore.path | String | Yes | - | Path to the Java keystore file |
keystore.password | String | Yes | - | Keystore password |
keystore.private-key-password | String | Yes | - | Private key password |
truststore.path | String | No | - | Path to the truststore file |
truststore.password | String | No | - | Truststore password |
client-authentication-mode | Enum | No | NONE | Client certificate authentication: NONE, OPTIONAL, REQUIRED |
handshake-timeout | Integer | No | 10000 | TLS handshake timeout in milliseconds |
protocols | List | No | JVM defaults | Enabled TLS protocols |
cipher-suites | List | No | JVM defaults | Enabled cipher suites |
prefer-server-cipher-suites | Boolean | No | - | Whether to prefer server cipher suites |
Client Authentication
To require client certificates, configure a truststore and set the authentication mode:WebSocket Listener
MQTT over WebSockets for browser-based clients.Configuration
Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
port | Integer (0-65535) | Yes | - | The port to listen on |
bind-address | String | No | 0.0.0.0 | The IP address to bind to |
path | String | No | /mqtt | The WebSocket endpoint path |
name | String | No | - | A descriptive name for the listener |
subprotocols | List | No | - | Allowed WebSocket subprotocols |
allow-extensions | Boolean | No | false | Whether to allow WebSocket extensions |
TLS WebSocket Listener
WebSocket listener with TLS/SSL encryption.Configuration
Multiple Listeners
You can configure multiple listeners of different types:Best Practices
- Use TLS listeners for production environments
- Bind to specific IP addresses instead of
0.0.0.0when possible - Use descriptive names for listeners to aid in debugging
- Configure appropriate timeouts for your use case
- Enable client authentication for enhanced security