docs: adds FAQ mentionning websockets and tinygo

This commit is contained in:
Nicolas Lepage 2025-02-06 11:17:08 +01:00
parent 9be33ecb4d
commit 065e91545b
No known key found for this signature in database
GPG Key ID: B0879E35E66D8F6F

View File

@ -20,7 +20,6 @@
- [Random password generator web server](https://nlepage.github.io/random-password-please/) ([sources](https://github.com/nlepage/random-password-please) forked from [jbarham/random-password-please](https://github.com/jbarham/random-password-please)) - [Random password generator web server](https://nlepage.github.io/random-password-please/) ([sources](https://github.com/nlepage/random-password-please) forked from [jbarham/random-password-please](https://github.com/jbarham/random-password-please))
- [Server fallbacks, and compiling with TinyGo](https://nlepage.github.io/go-wasm-http-server/tinygo/) (runs locally; see [sources & readme](https://github.com/nlepage/go-wasm-http-server/tree/master/docs/tinygo#readme) for how to run this example) - [Server fallbacks, and compiling with TinyGo](https://nlepage.github.io/go-wasm-http-server/tinygo/) (runs locally; see [sources & readme](https://github.com/nlepage/go-wasm-http-server/tree/master/docs/tinygo#readme) for how to run this example)
## How? ## How?
Talk given at the Go devroom of FOSDEM 2021 explaining how `go-wasm-http-server` works: Talk given at the Go devroom of FOSDEM 2021 explaining how `go-wasm-http-server` works:
@ -187,6 +186,18 @@ An optional object containing:
- `args` (`string[]`): Arguments for the WebAssembly module. - `args` (`string[]`): Arguments for the WebAssembly module.
- `passthrough` (`(request: Request): boolean`): Optional callback to allow passing the request through to network. - `passthrough` (`(request: Request): boolean`): Optional callback to allow passing the request through to network.
## <abbr title="Frequently Asked Questions">FAQ</abbr>
### Are WebSockets supported?
No, WebSockets arent and wont be supported, because Service Workers cannot intercept websocket connections.
However [Server Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events), which is an alternative to WebSockets, are supported, you can find the code for an example [here](https://github.com/nlepage/go-wasm-http-server/tree/master/docs/hello-sse) and the demo [here](https://nlepage.github.io/go-wasm-http-server/hello-sse/).
### Is it compatible with TinyGo?
Yes, an example and some specific information is available [here](https://github.com/nlepage/go-wasm-http-server/tree/master/docs/tinygo).
## Contributors ✨ ## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):