3 meta = with lib.maintainers; {
4 maintainers = [ misuzu ];
8 peer0 = { lib, ... }: {
9 networking.useDHCP = false;
10 networking.interfaces.eth1 = {
13 address = "192.168.0.1";
17 address = "216.58.211.111";
24 peer1 = { lib, ... }: {
25 networking.useDHCP = false;
26 networking.interfaces.eth1 = {
29 address = "192.168.0.2";
33 address = "216.58.211.112";
38 # test that binding to [::] is working when ipv6 is disabled
39 networking.enableIPv6 = false;
55 networking.firewall.allowedTCPPorts = [ 3128 9999 ];
58 peer2 = { lib, ... }: {
59 networking.useDHCP = false;
60 networking.interfaces.eth1 = {
63 address = "192.168.0.3";
67 address = "216.58.211.113";
92 networking.firewall.allowedTCPPorts = [ 3128 9999 ];
95 peer3 = { lib, pkgs, ... }: {
96 networking.useDHCP = false;
97 networking.interfaces.eth1 = {
100 address = "192.168.0.4";
104 address = "216.58.211.114";
111 usersFile = pkgs.writeText "3proxy.passwd" ''
112 admin:CR:$1$.GUV4Wvk$WnEVQtaqutD9.beO5ar1W/
132 networking.firewall.allowedTCPPorts = [ 3128 9999 ];
139 peer0.wait_for_unit("network-online.target")
141 peer1.wait_for_unit("3proxy.service")
142 peer1.wait_for_open_port(9999)
146 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://216.58.211.112:9999"
149 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://192.168.0.2:9999"
152 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.2:3128 -S -O /dev/null http://127.0.0.1:9999"
155 peer2.wait_for_unit("3proxy.service")
156 peer2.wait_for_open_port(9999)
160 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://216.58.211.113:9999"
163 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://192.168.0.3:9999"
166 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.3:3128 -S -O /dev/null http://127.0.0.1:9999"
169 peer3.wait_for_unit("3proxy.service")
170 peer3.wait_for_open_port(9999)
174 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://admin:bigsecret\@192.168.0.4:3128 -S -O /dev/null http://216.58.211.114:9999"
177 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://admin:bigsecret\@192.168.0.4:3128 -S -O /dev/null http://192.168.0.4:9999"
180 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://216.58.211.114:9999"
183 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://192.168.0.4:9999"
186 "${pkgs.wget}/bin/wget -e use_proxy=yes -e http_proxy=http://192.168.0.4:3128 -S -O /dev/null http://127.0.0.1:9999"