1 import ./make-test-python.nix (
5 successMessage = "Success 3333115147933743662";
9 meta.maintainers = with lib.maintainers; [ xokdvium ];
15 firewall.enable = false;
18 systemd.network.networks."01-eth1" = {
20 networkConfig.Address = "10.0.0.1/24";
28 bind_addr = "0.0.0.0:2333";
31 bind_addr = "0.0.0.0:80";
46 systemd.network.networks."01-eth1" = {
48 networkConfig.Address = "10.0.0.2/24";
53 virtualHosts."127.0.0.1" = {
54 root = pkgs.writeTextDir "success-message.txt" successMessage;
61 credentialsFile = pkgs.writeText "rathole-credentials.toml" ''
62 [client.services.success-message]
67 remote_addr = "10.0.0.1:2333";
68 services.success-message = {
69 local_addr = "127.0.0.1:80";
79 server.wait_for_unit("rathole.service")
80 server.wait_for_open_port(2333)
81 client.wait_for_unit("rathole.service")
82 server.wait_for_open_port(80)
83 response = server.succeed("curl http://127.0.0.1/success-message.txt")
84 assert "${successMessage}" in response, "Got invalid response"
85 response = client.succeed("curl http://10.0.0.1/success-message.txt")
86 assert "${successMessage}" in response, "Got invalid response"