Hacker News new | ask | show | jobs
by simmons 2817 days ago
Great work! I can really appreciate the effort you likely put into re-implementing SCTP, since I'm currently working on implementing SCTP in Rust for the same reasons (WebRTC support). :)
3 comments

That's awesome simmons! I can't wait to see Rust/Python/Go/Node all talking directly to each other. I really want to see a world where P2P communication is common.

It could really change how people design systems, have servers exchange data directly instead of overloading message brokers. Could have an even bigger impact on users! Instead we could see users exchanging files directly instead of depending on paid services!

I am the author of https://github.com/pions/webrtc we implemented SCTP, SRTP and working on DTLS now. So if you ever want to grab anything please do :) and always happy to chat if there is anything that could be better/any way we could help the rust implementation

> working on DTLS now

Any info or branch where I can watch? I am watching your project closely and curious about the OpenSSL requirement for DTLS considering Go's quality crypto stack. Is the work you're talking about for removing this dependency? If not, I might take a stab at it.

https://github.com/sean-der/dtls

There isn't a DTLS implementation right now that is maintained, and adopting one would be more work then starting from scratch. I didn't know anything about TLS before I started, so learning as I go.

I would love to work together on this! If you want to open a PR/issue I can give you commit access. Also join the Gophers slack and join the #pion channel, there is plenty of work to do and would love to split it with someone else :)

Yes this will remove the OpenSSL dependency! I am really excited when people can build for any platform that Go is supported on. After that I also want to start shipping C APIs, hoping people can build lots of cool things with it then.

I'll take a peek, but my schedule may not give me much time at the moment.

> After that I also want to start shipping C APIs, hoping people can build lots of cool things with it then.

I've found Go's FFI export story to be weak, especially on Windows.

> learning as I go

I am as well. After having read the spec and seeing its differences from TCP-based TLS, I may have a go, but not sure when. I'll give a shout if I get anywhere of note.

That's good news, the WebRTC world is too much of a libusrsctp monoculture to my taste at the moment. Don't be surprised if you find some interesting edge cases in browsers as you stray from the beaten track :)

https://bugzilla.mozilla.org/show_bug.cgi?id=1443032

Yipes! That's good to know about, thanks. At the same time, I've also been surprised at how lenient the browsers are at accepting associations from my incomplete implementation (e.g. without the required SCTP extensions, etc.).
I can confirm you can get data channels to work with zero SCTP extensions, I only added them afterwards!

One implementation (libusrsctp-based) you might want to interop with is rawrtc. Like aiortc's datachannel-cli example, it features copy-and-paste signaling which makes testing easy.

https://github.com/rawrtc/rawrtc

Lennart, rawrtc's author is very knowledgeable in all things DataChannels and active in the standardization process.

I'm really eager for a SCTP/WebRTC implementation in Rust! I took a stab at it, and re-implementing SCTP was the obstacle that stalled me.

Is your work on github/gitlab?

Yes [1], but it's incomplete, needs a lot of TODO resolution and cleanup, (insert other scary disclaimers here), etc. I also have some slides from a presentation [2].

[1] https://github.com/simmons/webrtc-sctp [2] https://cafbit.com/post/rust_webrtc_data_channels/

If the reason you guys want a WebRTC implementation in Rust is to be able to write WebRTC server software in Rust, you might be interested in Janus -- it's a plugin-based C WebRTC server with a C ABI for plugins that you can easily write in Rust.