Introduction
Configuration
Language Support
AMQP 0-9-1 Overview
More Exchange Types
More Consumer Features
Queue Deep-dive
Other Features
Reliable Message Delivery
High Availability
Monitoring
Management HTTP API
Tutorials
Networking
LavinMQ CLI
Websockets
LavinMQ offers support for Websockets via: AMQP and MQTT over Websockets.
Websockets in LavinMQ
With Websockets, information can be exchanged instantly without the need for repeated requests from the browser.
By combining AMQP or MQTT with Websocket, you can establish a connection between the web browser and LavinMQ, just like a bridge.
This arrangement enables the web application to send and receive AMQP or MQTT messages to and from other systems, even though the browser itself doesn’t directly support these protocols. It’s like giving the web application the ability to speak the same language as those systems.
The indispensable component in the AMQP or MQTT over Websocket arrangement with LavinMQ is the WebsocketProxy
module. This module acts as a proxy between Websocket clients and the normal TCP servers.
WebsocketProxy Functionality
The WebsocketProxy
module in LavinMQ supports both AMQP and MQTT protocols over Websockets. Depending on the Websocket endpoint path, the proxy determines whether to handle the connection as AMQP or MQTT.
Here’s how it works:
-
If the Websocket client connects to the
/mqtt
or/ws/mqtt
path, the connection is handled as an MQTT connection. -
For all other paths, the connection is handled as an AMQP connection.
This flexibility allows LavinMQ to support both protocols seamlessly over Websockets, enabling a wide range of use cases for IoT, messaging, and real-time communication.
Get started
Try out our websocket tutorial here
Ready to take the next steps? Here are some things you should keep in mind:
Managed LavinMQ instance on CloudAMQP
LavinMQ has been built with performance and ease of use in mind - we've benchmarked a throughput of about 1,000,000 messages/sec. You can try LavinMQ without any installation hassle by creating a free instance on CloudAMQP. Signing up is a breeze.
Help and feedback
We welcome your feedback and are eager to address any questions you may have about this piece or using LavinMQ. Join our Slack channel to connect with us directly. You can also find LavinMQ on GitHub.