web_server.h 717 B

12345678910111213141516171819
  1. #ifndef __WEB_SERVER_H__
  2. #define __WEB_SERVER_H__
  3. #include <stddef.h>
  4. /* Lightweight embedded web server for runtime configuration.
  5. * Listens on 0.0.0.0:<port>, serves a single-page config UI and a tiny
  6. * JSON API. Zero cost while no client is connected (blocking accept). */
  7. #define WEB_SERVER_PORT_DEFAULT 8080
  8. #define WEB_SERVER_PASS_DEFAULT "3730"
  9. /* Start the web server on a detached background thread.
  10. * config_path is the channels.conf this process was started with; edits are
  11. * applied by rewriting the file and restarting the service unit.
  12. * Returns 0 on success (thread started), -1 on bind/creation error. */
  13. int web_server_start(const char *config_path, int port, const char *password);
  14. #endif