8000 GitHub - johnpmayer/naia-socket: cross-platform (including Wasm!) sockets providing an unreliable & unordered network transport layer. Built on top of UDP & WebRTC
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cross-platform (including Wasm!) sockets providing an unreliable & unordered network transport layer. Built on top of UDP & WebRTC

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt
Notifications You must be signed in to change notification settings

johnpmayer/naia-socket

Repository files navigation

Build Status Latest Version API Documentation Discord chat MIT/Apache

naia-socket

A cross-platform (including Wasm!) Socket API that wraps unreliable & unordered communication, using WebRTC & UDP.

Utilizes Kyren's wonderful webrtc-unreliable

naia-client-socket is usable with both wasm-bindgen and miniquad (build for these with the feature wbindgen & mquad, respectively)

Demos

Server:

To run a UDP server on Linux: (that will be able to communicate with Linux clients)

1. cd demo/server
2. cargo run --features "use-udp"

To run a WebRTC server on Linux: (that will be able to communicate with Web clients)

1. cd demo/server
2. cargo run --features "use-webrtc"

Client:

To run a UDP client on Linux: (that will be able to communicate with a UDP server)

1. cd demo/client
2. cargo run

To run a WebRTC client on Web using wasm-bindgen: (that will be able to communicate with a WebRTC server)

1. Enter in your IP Address at the appropriate spot in demo/client/wasm-bindgen/src/app.rs
2. cd demo/client/wasm-bindgen
3. npm install              //should only need to do this once to install dependencies
4. npm run start            //this will open a web browser, and hot reload

To run a WebRTC client on Web using miniquad: (that will be able to communicate with a WebRTC server)

1. Enter in your IP Address at the appropriate spot in demo/client/miniquad/src/app.rs
2. cd demo/client/miniquad
3. cargo install watchexec   //should only need to do this once to install watchexec, which will auto-reload for you
4. ./deploy.sh               //this will open a web browser, and hot reload

To simply build these demos instead of running them, substitute the above commands like so:

`cargo build` for `cargo run`, and

`npm run build` for `npm run start`

About

cross-platform (including Wasm!) sockets providing an unreliable & unordered network transport layer. Built on top of UDP & WebRTC

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt

Stars

Watchers

Forks

Packages

No packages published
0