2019-05-20 02:01:25 +03:00
|
|
|
# WebSockets Example
|
|
|
|
|
|
|
|
[View documentation for this example online][dox] or [View compiled example
|
|
|
|
online][compiled]
|
|
|
|
|
|
|
|
[compiled]: https://rustwasm.github.io/wasm-bindgen/exbuild/websockets/
|
|
|
|
[dox]: https://rustwasm.github.io/wasm-bindgen/examples/websockets.html
|
|
|
|
|
|
|
|
You can build the example locally with:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ wasm-pack build --target web
|
|
|
|
```
|
|
|
|
|
|
|
|
Then serve the statics and navigate to `host:port`
|
|
|
|
|
|
|
|
```
|
|
|
|
# static server from https://crates.io/crates/https
|
|
|
|
http
|
|
|
|
|
|
|
|
# or use python
|
2020-04-28 20:16:54 +02:00
|
|
|
python2 -m SimpleHTTPServer
|
|
|
|
python3 -m http.server
|
2019-05-20 02:01:25 +03:00
|
|
|
```
|