Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
Signed-off-by: Kohei Tokunaga <[email protected]>
  • Loading branch information
ktock committed Sep 12, 2023
1 parent 03d8c82 commit 40f4c7e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ $ docker run --rm -p 8080:80 \
You can run the container on browser with several types of configurations:

- `localhost:8080/?net=browser`: Container with networking. [Network stack](./extras/c2w-net-proxy/) based on [`gvisor-tap-vsock`](https://github.com/containers/gvisor-tap-vsock) runs on browser and forwards HTTP/HTTPS packets using the browser's Fetch API. The set of accesible sites is restricted by the browser configuration (e.g. CORS restriction). See also [`./examples/networking/fetch`](./examples/networking/fetch/) for detalis.
- `localhost:8080/?net=delegate=ws://localhost:8888`: Container with networking. You need to run [user-space network stack](./cmd/c2w-net/) based on [`gvisor-tap-vsock`](https://github.com/containers/gvisor-tap-vsock) on the host (outside of browser). It forwards all packets received from the browser over WebSocket. See also [`./examples/networking/websocket`](./examples/networking/websocket/) for detalis and configuration.
- `localhost:8080/?net=delegate=ws://localhost:8888`: Container with networking. You need to run [user-space network stack](./cmd/c2w-net/) based on [`gvisor-tap-vsock`](https://github.com/containers/gvisor-tap-vsock) on the host (outside of browser). It forwards all packets received from the browser over WebSocket. See also [`./examples/networking/websocket`](./examples/networking/websocket/) for detalis and configuration. (tested only on Linux)
- `localhost:8080`: Container without networking.

#### emscripten on browser
Expand Down
4 changes: 3 additions & 1 deletion examples/networking/wasi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ WASI runtime binds the socket on a TCP port (e.g. using wasmtime's `--tcplisten`
The WASM image converted from the container has `--net` flag that enables this networking feature.
`--net=qemu` is the only supported mode which sends packets to `gvisor-tap-vsock` (wrapped by `c2w-net`) using [QEMU's forwarding protocol](https://github.com/containers/gvisor-tap-vsock#run-with-qemu-linux-or-macos).

> NOTE: By default, the WASM image tries to establish connection with `c2w-net` via WASI's fd=3.
> NOTE1: By default, the WASM image tries to establish connection with `c2w-net` via WASI's fd=3.
> However WASI runtimes might use larger fd when directory sharing is enabled.
> In that case, `--net=qemu=listenfd=<num>` flag can be used for configuring the WASM image to use the correct socket fd.
> NOTE2: This feature is tested only on Linux.
## Example

This doc shows examples for wasmtime and wazero.
Expand Down
2 changes: 2 additions & 0 deletions examples/networking/websocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ We provide a wrapper command [`c2w-net`](../../../cmd/c2w-net/) for container-on
`c2w-net` exposes an WebSocket port and it forwards all packets received from that WebSocket.
The container running on browser can connect to that WebSocket and pass all packets there and let `c2w-net` forward them on the host.

> NOTE: This feature is tested only on Linux.
## Getting `c2w` and `c2w-net`

`c2w` and `c2w-net` are available on the [release page](https://github.com/ktock/container2wasm/releases).
Expand Down

0 comments on commit 40f4c7e

Please sign in to comment.