-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factor out web media connection into model::connection::Connection #105
Factor out web media connection into model::connection::Connection #105
Conversation
…ction Pulled all the relevant code out of attendants.rs into model/connection/* including eliminating a bunch of yew Messages that had been used to set up the WebTransport connection. In doing the refactoring, organized the code into a few levels of abstraction: * webmedia.rs defines a WebMedia trait for MediaPacket based connections, to provide a connect() method that sets up the desired callbacks (in particular on_incoming_packet), and a send_packet() method to transmit packets. * websocket.rs and webtransport.rs implement the WebMedia trait for their respective mechanisms. websocket.rs is pretty trivial; webtransport contains the logic to handle the different types of streams and to buffer the data to construct and dispatch packets. * task.rs defines a generic interface over websocket and webtransport, and in particular handles the fallback rollover from webtransport to websocket * connection.rs defines the top-level public interface, which wraps the Task generic interface in a Connection struct that also handles heartbeats and keeps track of the connection status (to suppress attempts to send packets when the connection has been closed and to provide an is_connected() method).
hey @ronen !! are you facing cert issues? if so, please launch chrome with https://github.com/security-union/videocall-rs/blob/main/launch_chrome.sh make sure that you launch chrome first, then the API so that certs match |
You can also use https://transport.rustlemania.com:443 I believe to avoid launching chrome with that script |
Thanks, but I don't get as far as cert issue :) My question is more basic: How do I even run with WebTransport enabled? My intent to run with the server on my local machine, trying it out by connecting a few times to I normally just run:
Which only attempts a Websocket connection. I've tried
But then the server seems to crash and the web pages don't load at all. I haven't dug into it to figure out why, just assumed I'm doing something wrong. What is the proper way to run with WebTransport? |
(Sorry for slow response. I'm traveling with only intermittent time & web access.) I can successfully connect to rustlemania.com with webtransport true. But I haven't been able to do it locally in
also, in the terminal the messages from
Can you give me really basic step-by-step instructions for how to get |
Hi, I saw #108 go by that addresses So I merged the latest So AFAICT this PR is ready for you to look at / try out yourself. |
@ronen fantastic!! I'll do that |
Co-authored-by: Griffin Obeid <[email protected]>
…ecurity-union#105) * Factor out web media connection and use into model::connection::Connection Pulled all the relevant code out of attendants.rs into model/connection/* including eliminating a bunch of yew Messages that had been used to set up the WebTransport connection. In doing the refactoring, organized the code into a few levels of abstraction: * webmedia.rs defines a WebMedia trait for MediaPacket based connections, to provide a connect() method that sets up the desired callbacks (in particular on_incoming_packet), and a send_packet() method to transmit packets. * websocket.rs and webtransport.rs implement the WebMedia trait for their respective mechanisms. websocket.rs is pretty trivial; webtransport contains the logic to handle the different types of streams and to buffer the data to construct and dispatch packets. * task.rs defines a generic interface over websocket and webtransport, and in particular handles the fallback rollover from webtransport to websocket * connection.rs defines the top-level public interface, which wraps the Task generic interface in a Connection struct that also handles heartbeats and keeps track of the connection status (to suppress attempts to send packets when the connection has been closed and to provide an is_connected() method). * connection log messages * Update yew-ui/src/components/attendants.rs Co-authored-by: Griffin Obeid <[email protected]> --------- Co-authored-by: Dario A Lencina-Talarico <[email protected]> Co-authored-by: Griffin Obeid <[email protected]>
…ecurity-union#105) * Factor out web media connection and use into model::connection::Connection Pulled all the relevant code out of attendants.rs into model/connection/* including eliminating a bunch of yew Messages that had been used to set up the WebTransport connection. In doing the refactoring, organized the code into a few levels of abstraction: * webmedia.rs defines a WebMedia trait for MediaPacket based connections, to provide a connect() method that sets up the desired callbacks (in particular on_incoming_packet), and a send_packet() method to transmit packets. * websocket.rs and webtransport.rs implement the WebMedia trait for their respective mechanisms. websocket.rs is pretty trivial; webtransport contains the logic to handle the different types of streams and to buffer the data to construct and dispatch packets. * task.rs defines a generic interface over websocket and webtransport, and in particular handles the fallback rollover from webtransport to websocket * connection.rs defines the top-level public interface, which wraps the Task generic interface in a Connection struct that also handles heartbeats and keeps track of the connection status (to suppress attempts to send packets when the connection has been closed and to provide an is_connected() method). * connection log messages * Update yew-ui/src/components/attendants.rs Co-authored-by: Griffin Obeid <[email protected]> --------- Co-authored-by: Dario A Lencina-Talarico <[email protected]> Co-authored-by: Griffin Obeid <[email protected]>
[Another step towards #74]
@darioalessandro: I haven't tested this with WebTransport -- I don't know how.
Even in
main
I can't/don't know how to get webtransport working?!So the WebTransport parts of this PR are all of the hopeful vein "if it compiles it probably works" -- I didn't write any real new logic it's all just rearranging the existing code, so that's got a reasonable chance of being true :) But of course you should test it. And/or can you explain how to run with webtransport locally on my mac?
Here's what's in the PR:
Pulled all the relevant code out of
attendants.rs
intomodel/connection/*
including eliminating a bunch of yew Messages that had been used to set up the WebTransport connection.In doing the refactoring, organized the code into a few levels of abstraction. From the bottom up, they are:
webmedia.rs
defines aWebMedia
trait for MediaPacket-based connections, to provide aconnect()
method that sets up the desired callbacks (in particularon_incoming_packet
), and asend_packet()
method to transmit packets.websocket.rs
andwebtransport.rs
implement theWebMedia
trait for their respective mechanisms. websocket.rs is pretty trivial; webtransport contains the logic to handle the different types of streams and to buffer the data to construct and dispatch packets.task.rs
defines a genericTask
interface over websocket and webtransport, and in particular handles the fallback rollover from webtransport to websocketconnection.rs
defines the top-level public interface, which wraps theTask
interface in aConnection
struct that also handles heartbeats and keeps track of the connection status, so that it can suppress attempts to send packets when the connection has been closed and can provide anis_connected()
method.