11package wasi : http @ 0.3.0-rc-2025-09-16;
22
3- /// The `wasi:http/imports` world imports all the APIs for HTTP proxies .
3+ /// The `wasi:http/imports` world imports all the APIs for HTTP services .
44/// It is intended to be `include` d in other worlds.
55world imports {
6- /// HTTP proxies have access to time and randomness.
6+ /// HTTP services have access to time and randomness.
77 include wasi :clocks /imports @ 0.3.0-rc-2025-09-16 ;
88 import wasi :random /random @ 0.3.0-rc-2025-09-16 ;
99
10- /// Proxies have standard output and error streams which are expected to
10+ /// Services have standard output and error streams which are expected to
1111 /// terminate in a developer-facing console provided by the host.
1212 import wasi :cli /stdout @ 0.3.0-rc-2025-09-16 ;
1313 import wasi :cli /stderr @ 0.3.0-rc-2025-09-16 ;
@@ -18,19 +18,15 @@ world imports {
1818 /// when this import is properly removed.
1919 import wasi :cli /stdin @ 0.3.0-rc-2025-09-16 ;
2020
21- /// This is the default handler to use when user code simply wants to make an
21+ /// This is the default `client` to use when user code simply wants to make an
2222 /// HTTP request (e.g., via `fetch()` ).
23- ///
24- /// This may also be used to pass synthesized or forwarded requests to another
25- /// component.
26- import handler ;
23+ import client ;
2724}
2825
29- /// The `wasi:http/proxy` world captures a widely-implementable intersection of
30- /// hosts that includes HTTP forward and reverse proxies. Components targeting
31- /// this world may concurrently stream in and out any number of incoming and
32- /// outgoing HTTP requests.
33- world proxy {
26+ /// The `wasi:http/service` world captures a broad category of HTTP services
27+ /// including web applications, API servers, and proxies. It may be `include` d
28+ /// in more specific worlds such as `wasi:http/gateway` .
29+ world service {
3430 include imports ;
3531
3632 /// The host delivers incoming HTTP requests to a component by calling the
@@ -42,3 +38,13 @@ world proxy {
4238 /// another component.
4339 export handler ;
4440}
41+
42+ /// The `wasi:http/middleware` world captures HTTP services that forward HTTP
43+ /// Requests to another handler. Components may implement this world to allow
44+ /// them to participate in handler "chains" where a Request flows through
45+ /// handlers on its way to some "terminal" service and corresponding Responses
46+ /// flow in the opposite direction.
47+ world middleware {
48+ include service ;
49+ import handler ;
50+ }
0 commit comments