|
1 | | -package wasi:http@0.2.0; |
| 1 | +package wasi:http@0.2.3; |
2 | 2 |
|
3 | | -/// The `wasi:http/proxy` world captures a widely-implementable intersection of |
4 | | -/// hosts that includes HTTP forward and reverse proxies. Components targeting |
5 | | -/// this world may concurrently stream in and out any number of incoming and |
6 | | -/// outgoing HTTP requests. |
7 | | -world proxy { |
| 3 | +/// The `wasi:http/imports` world imports all the APIs for HTTP proxies. |
| 4 | +/// It is intended to be `include`d in other worlds. |
| 5 | +@since(version = 0.2.0) |
| 6 | +world imports { |
8 | 7 | /// HTTP proxies have access to time and randomness. |
9 | | - include wasi:clocks/imports@0.2.0; |
10 | | - import wasi:random/random@0.2.0; |
| 8 | + @since(version = 0.2.0) |
| 9 | + import wasi:clocks/monotonic-clock@0.2.3; |
| 10 | + @since(version = 0.2.0) |
| 11 | + import wasi:clocks/wall-clock@0.2.3; |
| 12 | + @since(version = 0.2.0) |
| 13 | + import wasi:random/random@0.2.3; |
11 | 14 |
|
12 | 15 | /// Proxies have standard output and error streams which are expected to |
13 | 16 | /// terminate in a developer-facing console provided by the host. |
14 | | - import wasi:cli/stdout@0.2.0; |
15 | | - import wasi:cli/stderr@0.2.0; |
| 17 | + @since(version = 0.2.0) |
| 18 | + import wasi:cli/stdout@0.2.3; |
| 19 | + @since(version = 0.2.0) |
| 20 | + import wasi:cli/stderr@0.2.3; |
16 | 21 |
|
17 | 22 | /// TODO: this is a temporary workaround until component tooling is able to |
18 | 23 | /// gracefully handle the absence of stdin. Hosts must return an eof stream |
19 | 24 | /// for this import, which is what wasi-libc + tooling will do automatically |
20 | 25 | /// when this import is properly removed. |
21 | | - import wasi:cli/stdin@0.2.0; |
| 26 | + @since(version = 0.2.0) |
| 27 | + import wasi:cli/stdin@0.2.3; |
22 | 28 |
|
23 | 29 | /// This is the default handler to use when user code simply wants to make an |
24 | 30 | /// HTTP request (e.g., via `fetch()`). |
| 31 | + @since(version = 0.2.0) |
25 | 32 | import outgoing-handler; |
| 33 | +} |
| 34 | + |
| 35 | +/// The `wasi:http/proxy` world captures a widely-implementable intersection of |
| 36 | +/// hosts that includes HTTP forward and reverse proxies. Components targeting |
| 37 | +/// this world may concurrently stream in and out any number of incoming and |
| 38 | +/// outgoing HTTP requests. |
| 39 | +@since(version = 0.2.0) |
| 40 | +world proxy { |
| 41 | + @since(version = 0.2.0) |
| 42 | + include imports; |
26 | 43 |
|
27 | 44 | /// The host delivers incoming HTTP requests to a component by calling the |
28 | 45 | /// `handle` function of this exported interface. A host may arbitrarily reuse |
29 | 46 | /// or not reuse component instance when delivering incoming HTTP requests and |
30 | 47 | /// thus a component must be able to handle 0..N calls to `handle`. |
| 48 | + @since(version = 0.2.0) |
31 | 49 | export incoming-handler; |
32 | 50 | } |
0 commit comments