Add Unix socket support for go2rtc

This commit introduces Unix socket support for go2rtc. The configuration file for go2rtc has been updated to include a new key "unix_listen" with a value of "/tmp/go2rtc.sock". This change allows go2rtc to listen on a Unix socket instead of a TCP port.

Additionally, the nginx configuration has been updated to use the Unix socket for communication with go2rtc. The previous TCP server configuration has been removed. This change should improve performance by eliminating the TCP overhead.
This commit is contained in:
Sergey Krashevich 2023-11-21 01:28:11 +03:00
parent 8864e33d1c
commit 499d06c366
No known key found for this signature in database
GPG Key ID: 625171324E7D3856
2 changed files with 3 additions and 2 deletions

View File

@ -48,6 +48,8 @@ if go2rtc_config.get("api") is None:
elif go2rtc_config["api"].get("origin") is None:
go2rtc_config["api"]["origin"] = "*"
go2rtc_config["api"]["unix_listen"] = "/tmp/go2rtc.sock"
# Need to set default location for HA config
if go2rtc_config.get("hass") is None:
go2rtc_config["hass"] = {"config": "/config"}

View File

@ -55,8 +55,7 @@ http {
}
upstream go2rtc {
server 127.0.0.1:1984;
keepalive 1024;
server unix:/tmp/go2rtc.sock;
}
server {