Rectangle 27 0

To install lighttpd with websocket support on Ubuntu

I had a lot of trouble getting this to work for me and wanted to post solution for Ubuntu that was quickest/easiest for me.

For Ubuntu 12.04 LTS (Precise), the lines are:

deb http://ppa.launchpad.net/roger.light/ppa/ubuntu precise main
deb-src http://ppa.launchpad.net/roger.light/ppa/ubuntu precise main
apt-get update
apt-get install lighttpd lighttpd-mod-websocket
server.modules = ( "mod_websocket", )

websocket.server = (
    "/mqtt" => (
        "host" => "127.0.0.1",
        "port" => "1883",
        "type" => "bin",
        "subproto" => "mqttv3.1"
    ),
)

...
server.port = 8080
http://hostname:8080
service lighttpd restart

Trouble to get MQTT JavaScript Client running - Stack Overflow

javascript mqtt