Jacob Dufault | 75fb442a5 | 2018-10-05 16:50:54 | [diff] [blame] | 1 | # Working with Restrictive Networks |
| 2 | |
| 3 | ChromeOS login supports letting the user connect to a restricted network, |
| 4 | such as one that has a captive portal (e.g. a terms of service screen). |
| 5 | |
| 6 | Testing on a restricted network can be tricky. The most robust way to test is |
| 7 | to actually connect your device to a restricted network, but this can greatly |
| 8 | slow iteration time. An alternative is to run chrome locally with |
| 9 | `--proxy-server` and run a proxy HTTP server locally that emulates the |
| 10 | restricted network. |
| 11 | |
| 12 | ## go-authproxy |
| 13 | |
| 14 | [go-authproxy](https://github.com/jacobdufault/go-authproxy) is a proxy that |
| 15 | implements HTTP basic authentication and supports serving a captive portal. |
| 16 | |
| 17 | To 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 | |
| 26 | To 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 | ``` |