A unified WebTransport API that you can use for browser/native cross platform apps. Originally to power the networking layer of the games made with the bevy engine - but can be applied elsewhere too.
By @leaden wind https://github.com/MOZGIII/xwt
#xwt
37 messages · Page 1 of 1 (latest)
Wow, such great work here, thank you 🙂
Do you you have any docs to help run the tests?
I understand the focus here is on running native/wasm WebTransport clients, but does anything in this crate help you run a WT Server? What would your recommendations be for crates to help you do that / what setup are you using for your own development?
Thank you 🙏
For the server I'd recommend using wtransport
xwt is indeed more focus on the clientside right now, although the server support is present too - but it is not tested or used anywhere afaik.
The wtransport really aim to be a one-stop-shop for the native clients, but I also use a crate for rustls certificates reloader, as in my production certificates automatically refreshed from let's encrypt by kubernetes - so my app just has to reload them often enough.
Overall, there are a bunch of crates that implement networking for bevy on top of xwt, like the lightyear and aesocket - consider using those instead of the low-level xwt
Also it is now possible to add support for xwt to bevy_replicon - although is has not yet been done
Thanks for the info 🙂 yeah I'm investigating how to go about adding a WT transport layer to my networking library naia ..
when I looked at doing this in the past, it seemed that there would be a bit more research/dev I'd need to do to automate away all the cert management stuff from the users of my library .. I'd like to be able to never think about it server-side or client-side ..
Anyway, I'm still curious what steps are necessary for running the tests (including the test server) in xwt, also what fiddling I need to do with certs, I'd like to use a Rust crate or write my own to refresh certs instead of having to rely on kubernetes.
Thanks for any help / advice 🙏
cargo run to run the test server
Then cargo test to run tests while the server is running
cargo test --target wasm32-unknown-unknown to test wasm (will run a browser under the hood)
You can also peek at what the CI is doing
that simple hm? awesome thank you 🙂
Yep, I tried to make it really easy for everyone's benefit 😄
Hi, some users have had issues using webtransport in Firefox (https://github.com/cBournhonesque/lightyear/issues/251); I'm curious if you had any experience with this. Could it be because some datagram apis are not supported with firefox? (https://wpt.fyi/results/webtransport/datagrams.https.any.html?label=experimental&label=master&aligned)
Also I switched to the latest version of xwt_web_sys (https://github.com/cBournhonesque/lightyear/pull/245/files#diff-ebb88a5b1131352d39b3bf349ef351e509b87e96e5f00680e36aeb25480b186fR40); I'm not sure if there are any of the xwt-cert-fingerprints functions that I should be using instead of what I'm doing now?
This is actually most likely the issue with the server-side
Firefox requires some special response from the server, I don't recall exactly - but please report this to wtransport
You could use fingerprinting API instead, yes - the SHA256 fingerprinting facilities is what you're looking for; but what you do is also fine
But you could alsp parse the certificate from pem and use a sha256 sum of its der form - so you'd only need the certificate itself, and not its hashes
I see, thanks! Using this function? https://github.com/MOZGIII/xwt/blob/aa62c46f10d793371d37bf578e2866db16d59a2b/crates/xwt-cert-fingerprint/src/lib.rs#L104
Yep
We now have a usage example: https://github.com/MOZGIII/xwt/tree/master/examples/microapp
Man that helps a lot, thank you for all this work! 💪
Quick question - do you know of any reason (other than the fact xwt is still WIP) you might not want to use the test crates like xwt-test-assets-build xwt-test-assets & xwt-test-server in production?
I'm just wondering why the names indicate they are only for testing, and if anything fundamentally different would need to be done in production. Thank you 🙏
They'll generate certificates and cache thme in the build tree that expire in two weeks; they also bring them into the binary images are burnt in constants - so, very unfit for production
Also private key is also burnt-in to the client binary - you woun't want that for production apps
Btw, I have found pretty odd delays while testing examples with Chrome; no idea at all if the issue is with Chrome implementation of WebTransport, the wtransport server or somewhere in the xwt or the example code itself
Hi is it possible to update the timeout of the webtransport connection at runtime?
On native yes, on web no way to alter it at all
Apparently not on native either: https://github.com/BiagioFesta/wtransport/issues/184
Yeah, not for the established connections
But it can be addrd if needed
There are also different timeouts, some of them can be changed for a quic connection, some of them can't, and some just don't make sense after the connection is established
Referring to keepalive timeout
We not have max datagram size support at the API, thx to https://github.com/MOZGIII/xwt/pull/159
Released now
Did you know we made https://docs.rs/web-wt-sys ? If you need only WebTransport API in Web WASM and as low-level as possible - this is a better way to go than the xwt crates. Is it still a part of the xwt repo and maintained together with the rest of xwt crates.
Hand-crafted low-level Web API bindings for WebTransport.