maddox / harmony-api

🗼 A simple server allowing you to query/control multiple local Harmony Home Hubs over HTTP or MQTT
MIT License
393 stars 115 forks source link

Add HTTPS server #96

Open misku opened 6 years ago

misku commented 6 years ago

Configuration example:

"http_server": {
  "type": "https",
  "port": 8891,
  "cert": "/path/to/fullchain.pem",
  "key": "/path/to/privkey.pem"
}

type: "http" | "https" (default: "http") port: (default 8282) cert: path to server certificate key : path to private key

If "http_server" key is missing, no HTTP server will be started. If "type" == "https" && ("cert" || "key" is missing or corrupted) an error will be thrown.

maddox commented 6 years ago

This is great, thanks! Just a couple of notes.

  1. Could you make it so enableHTTPserver still enables the http server. Otherwise it will break current installs after an upgrade. This is an easy way to keep some backwards compat.
  2. Could you document this in the README.
misku commented 6 years ago

Sure, no problem. I'm glad you like it.