3 meta.maintainers = with lib.maintainers; [ misuzu ];
6 peer0 = { lib, ... }: {
7 networking.useDHCP = false;
8 networking.interfaces.eth1 = {
11 address = "192.168.0.1";
15 address = "216.58.211.111";
22 peer1 = { lib, ... }: {
23 networking.useDHCP = false;
24 networking.interfaces.eth1 = {
27 address = "192.168.0.2";
31 address = "216.58.211.112";
36 # test that binding to [::] is working when ipv6 is disabled
37 networking.enableIPv6 = false;
53 networking.firewall.allowedTCPPorts = [ 3128 9999 ];
56 peer2 = { lib, ... }: {
57 networking.useDHCP = false;
58 networking.interfaces.eth1 = {
61 address = "192.168.0.3";
65 address = "216.58.211.113";
90 networking.firewall.allowedTCPPorts = [ 3128 9999 ];
93 peer3 = { lib, pkgs, ... }: {
94 networking.useDHCP = false;
95 networking.interfaces.eth1 = {
98 address = "192.168.0.4";
102 address = "216.58.211.114";
109 usersFile = pkgs.writeText "3proxy.passwd" ''
110 admin:CR:$1$.GUV4Wvk$WnEVQtaqutD9.beO5ar1W/
130 networking.firewall.allowedTCPPorts = [ 3128 9999 ];
137 peer0.systemctl("start network-online.target")
138 peer0.wait_for_unit("network-online.target")
140 peer1.wait_for_unit("3proxy.service")
141 peer1.wait_for_open_port(9999)
145 "${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"
148 "${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"
151 "${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"
154 peer2.wait_for_unit("3proxy.service")
155 peer2.wait_for_open_port(9999)
159 "${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"
162 "${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"
165 "${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"
168 peer3.wait_for_unit("3proxy.service")
169 peer3.wait_for_open_port(9999)
173 "${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"
176 "${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"
179 "${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"
182 "${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"
185 "${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"