nixos-config/mastus/wstunnel.nix

25 lines
516 B
Nix
Raw Normal View History

2019-10-03 19:19:07 +02:00
{ config, pkgs, ... }:
let
port = 58613;
in
{
systemd.services.wstunnel = rec {
2020-10-30 17:58:08 +01:00
path = [ pkgs.wstunnel ];
2019-10-03 19:19:07 +02:00
wantedBy = [ "nginx.service" ];
after = [ "network.target" ];
script = ''
2019-10-03 19:58:46 +02:00
wstunnel --server --restrictTo=htdf-gw.gebner.org:35869 ws://localhost:${toString port}
2019-10-03 19:19:07 +02:00
'';
};
services.nginx.virtualHosts."gebner.org".locations = {
"/wstunnel/udp/htdf-gw.gebner.org/35869" = {
proxyWebsockets = true;
proxyPass = "http://localhost:${toString port}";
};
};
}