Home Documentation Tutorials API GitHub

HTTP Server

HTTP server support in Studs is provided by the Httpd daemon.


To start a server with the default configuration of port 80 and OTA updates enabled, start the daemon with no arguments:


To customize HTTP settings pass a HttpConfig instance:

config := HttpConfig
  it.port = 8001
  it.root = MyWebMod()


OTA Firmware Updates

Applying firmware updates over-the-air is performed with a standard HTTP PUT request where the Content-Type header is application/x-firmware, and the request body is the firmware file.

Pushing Updates

The simplest way to push updates to a device is using the studs push CLI. This will update a device using the default HttpConfig settings:

fan studs push

If your device is using non-standard settings:

# alternate port
fan studs push

# custom otaUpdateUri
fan studs push /custom/update/uri

Example using curl:

curl -T my-firmware.fw -H "Content-Type: application/x-firmware" \

Devices are implicitly rebooted after an OTA firmware update has been received to apply. See Disabling Updates for how to customize this behavior.

Disabling Updates

To completely disable OTA firmware updates, configure otaUpdateUri to null:

config := HttpConfig { it.otaUpdateUri = null }

This will disable Httpd support for OTA updates. You may, however, still manually implement this functionality in your own WebMod using Sys.updateFirmware.