3
3
## Summary
4
4
5
5
The goal of this RFC is to enable web platform tests to cover the
6
- [ Private Network Access] ( https://wicg.github.io/private -network-access )
6
+ [ Local Network Access] ( https://wicg.github.io/local -network-access )
7
7
specification entirely. More specifically, to enable tests to exercise user
8
- agent behavior in the face of responses served from ` local ` , ` private ` and
8
+ agent behavior in the face of responses served from ` loopback ` , ` local ` and
9
9
` public `
10
- [ address spaces] ( https://wicg.github.io/private -network-access#ip-address-space ) .
10
+ [ address spaces] ( https://wicg.github.io/local -network-access#ip-address-space ) .
11
11
12
12
This is achieved by passing configuration parameters to the browser under test
13
13
forcing it to artificially consider specific (IP address, port) pairs to be
14
- ` local ` , ` private ` or ` public ` .
14
+ ` loopback ` , ` local ` or ` public ` .
15
15
16
16
This RFC aims to fix
17
17
[ web-platform-tests/wpt #26166 ] ( https://github.com/web-platform-tests/wpt/issues/26166 ) .
@@ -26,24 +26,24 @@ address space derived from specific (IP address, port) endpoints. For example,
26
26
this could be a command-line flag:
27
27
28
28
``` sh
29
- --ip-address-space-overrides=127.0.0.1:8000=private ,127.0.0.1:8001=public
29
+ --ip-address-space-overrides=127.0.0.1:8000=local ,127.0.0.1:8001=public
30
30
```
31
31
32
32
Test-only code wires this command-line flag to the code in the browser under
33
33
test that determines the address space of a network endpoint.
34
34
35
35
### Test environment changes
36
36
37
- New ports are introduced on which to serve artificially-` private ` and
37
+ New ports are introduced on which to serve artificially-` local ` and
38
38
artificially-` public ` resources. These are named after the existing protocols
39
- with ` -private ` and ` -public ` suffixes. Concretely, the server ` Config ` object
39
+ with ` -local ` and ` -public ` suffixes. Concretely, the server ` Config ` object
40
40
sees its ` ports ` field extended with entries like the following:
41
41
42
42
``` python
43
43
{
44
- " http-private " : [8002 ],
44
+ " http-local " : [8002 ],
45
45
" http-public" : [8003 ],
46
- " https-private " : [8445 ],
46
+ " https-local " : [8445 ],
47
47
" https-public" : [8446 ],
48
48
}
49
49
```
@@ -58,7 +58,7 @@ that the browsers implement the custom address space mapping described above
58
58
during tests.
59
59
60
60
This allows web platform tests to exercise browser behavior in the face of
61
- ` private ` and ` public ` IP addresses, simply by targeting the above ports.
61
+ ` local ` and ` public ` IP addresses, simply by targeting the above ports.
62
62
63
63
For example, a JS test wishing to make a request to a ` public ` server can
64
64
make use of the server-side substitution feature of ` wptserve ` to do so:
@@ -88,7 +88,7 @@ of other IP addresses than 127.0.0.1 to run `wptserve` on.
88
88
The following IP addresses see their IP address space overridden:
89
89
90
90
```
91
- 127.1.0.1: private
91
+ 127.1.0.1: local
92
92
127.2.0.1: public
93
93
```
94
94
@@ -97,7 +97,7 @@ is otherwise very similar to that described in the proposal above.
97
97
98
98
The WPT infrastructure is modified to run new servers on these IP addresses, by
99
99
the way of two new domains: ` public-web-platform.test ` and
100
- ` private -web-platform.test` . These are added to the system hosts file. All
100
+ ` local -web-platform.test` . These are added to the system hosts file. All
101
101
subdomains and protocols are supported on these new domains.
102
102
103
103
See web-platform-tests/wpt #28768 for an abandoned experimental implementation.
@@ -135,15 +135,15 @@ per subnet.
135
135
The marginal difficulty of overriding per subnet seems low, and provides plenty
136
136
of test IP addresses to exercise intra-address-space, cross-ip-address requests,
137
137
which might come in handy [ in the
138
- future] ( https://github.com/WICG/private -network-access/pull/1#issuecomment-721110250 ) .
138
+ future] ( https://github.com/WICG/local -network-access/pull/1#issuecomment-721110250 ) .
139
139
140
140
### Use real IP addresses
141
141
142
142
If we need to test user agent behavior in the face of a variety of IP addresses,
143
143
then... just do it!
144
144
145
145
This approach would have the web platform test runner configure additional
146
- loopback network devices and assign them ` private ` and ` public ` IP addresses.
146
+ loopback network devices and assign them ` local ` and ` public ` IP addresses.
147
147
Alternatively, the test runner could probably reroute traffic heading for these
148
148
IP addresses to ` 127.0.0.1 ` through some iptables magic. Then we could configure
149
149
the hosts file to resolve specific domains to those IP addresses, and test the
0 commit comments