Add support CORS for API

This commit is contained in:
Alexey Khit
2022-11-23 20:34:06 +03:00
parent 1ddf7f1a6c
commit bd51069086
3 changed files with 37 additions and 34 deletions
+4 -3
View File
@@ -313,9 +313,10 @@ The HTTP API is the main part for interacting with the application. Default addr
```yaml
api:
listen: ":1984" # HTTP API port ("" - disabled)
base_path: "" # API prefix for serve on suburl
static_dir: "" # folder for static files (custom web interface)
listen: ":1984" # HTTP API port ("" - disabled)
base_path: "/rtc" # API prefix for serve on suburl (/api => /rtc/api)
static_dir: "www" # folder for static files (custom web interface)
origin: "*" # allow CORS requests (only * supported)
```
**PS. go2rtc** doesn't provide HTTPS or password protection. Use [Nginx](https://nginx.org/) or [Ngrok](#module-ngrok) or [Home Assistant Add-on](#go2rtc-home-assistant-add-on) for this tasks.