blob: cebeba666fac1fe780cd62454534951301472e1d [file] [log] [blame] [view]
Jacob Dufault75fb442a52018-10-05 16:50:541# Working with Restrictive Networks
2
3ChromeOS login supports letting the user connect to a restricted network,
4such as one that has a captive portal (e.g. a terms of service screen).
5
6Testing on a restricted network can be tricky. The most robust way to test is
7to actually connect your device to a restricted network, but this can greatly
8slow iteration time. An alternative is to run chrome locally with
9`--proxy-server` and run a proxy HTTP server locally that emulates the
10restricted network.
11
12## go-authproxy
13
14[go-authproxy](https://github.com/jacobdufault/go-authproxy) is a proxy that
15implements HTTP basic authentication and supports serving a captive portal.
16
17To require HTTP basic authentication
18
19```sh
20# terminal A
21$ go-authproxy -basic-auth user:pass # interrupt (e.g. <c-c>) to shutdown
22# terminal B
23$ chrome --proxy-server="127.0.0.1:8080"
24```
25
26To show a captive portal
27
28```sh
29# terminal A
30$ go-authproxy -captive-portal # interrupt (e.g. <c-c>) to shutdown
31# terminal B
32$ chrome --proxy-server="127.0.0.1:8080"
33```