totoro/swann: do shenanigans with PS5 RTMP

This commit is contained in:
Luke Granger-Brown 2021-09-30 17:10:52 +00:00
parent fb16bea95c
commit c535655086
2 changed files with 24 additions and 0 deletions

View file

@ -192,6 +192,10 @@ in {
internalInterfaces = ["en-general"]; internalInterfaces = ["en-general"];
externalInterface = "en-virginmedia"; externalInterface = "en-virginmedia";
extraCommands = '' extraCommands = ''
# Send PS5 RTMP to totoro instead.
# See DHCP static lease.
iptables -w -t nat -A nixos-nat-pre --src 92.118.30.18 -p tcp --dport 1935 -j DNAT --to-destination 192.168.1.40
# NAT packets going over EE plain. # NAT packets going over EE plain.
iptables -w -t nat -A nixos-nat-post -m mark --mark 1 -o en-ee -j MASQUERADE iptables -w -t nat -A nixos-nat-post -m mark --mark 1 -o en-ee -j MASQUERADE
@ -273,6 +277,7 @@ in {
{ {
hostName = "ps5"; hostName = "ps5";
ethernetAddress = "bc:33:29:26:01:5c"; ethernetAddress = "bc:33:29:26:01:5c";
# This is used for DNAT on RTMP, above.
ipAddress = "92.118.30.18"; ipAddress = "92.118.30.18";
} }
]; ];

View file

@ -115,6 +115,25 @@ in {
services.nginx = { services.nginx = {
enable = true; enable = true;
package = pkgs.nginxMainline;
additionalModules = with pkgs.nginxModules; [
rtmp
];
appendConfig = ''
rtmp {
server {
listen 1935;
chunk_size 4000;
application app {
live on;
record off;
allow publish all;
allow play all;
push rtmp://coventry.beam.bfob.gg/beam/thecakeisalie;
}
}
}
'';
virtualHosts = { virtualHosts = {
"invoices.lukegb.com" = let "invoices.lukegb.com" = let
fastcgi = { fastcgi = {