Skip to content

Instantly share code, notes, and snippets.

View sisomm's full-sized avatar

Simen Sommerfeldt sisomm

View GitHub Profile
@claws
claws / mqtt-ws-proxy
Created February 3, 2014 23:39
Simple WebSockets Proxy for a MQTT broker
# This gist demonstrates a simple method to create a WebSockets proxy for a MQTT broker.
# I use this method to provide a WebSockets interface for the Mosquitto MQTT broker.
# This lets my browser based MQTT applications to access my MQTT broker.
# I consider this approach simpler than the common alternative which is to run lighttpd
# with the mod_websocket addon which can be complex to setup.
#
# Dependencies are Python, Twisted and Autobahn.
#
# This example sets up a WebSockets server listening on localhost:9000. Messages received from
# WebSocket clients are forwarded to the MQTT broker using the endpointforward plugin provided