jart / cosmopolitan

build-once run-anywhere c library
ISC License
18.27k stars 625 forks source link

[FR] Expect redbean to support websocket #439

Open lost22git opened 2 years ago

jart commented 2 years ago

I agree. Redbean should support websockets. It's something we don't have planned immediately but we certainly intend to do it in the not too distant future.

javajosh commented 2 years ago

I am also quite interested in websocket support. Any leads on this in terms of libraries? Or do you intend to implement something in the redbean.c file?

jart commented 2 years ago

We intend to implement it since the mechanics of websockets are pretty deeply intertwined with the workings of a web server. If there's any off the shelf helpers we can use for some key aspects of it, then we'd use them. But overall the process is just drilling through the RFC and writing tests.

javajosh commented 2 years ago

Today I've forked and built jart/cosmopolitan, started reading through redbean.c and also rfc6455.txt (each of which, interestingly enough, are about 7k lines). I have little experience with c, but I find the code quite readable. Justine, can you recommend any resources that might proactively ease my pain with c and its tooling, especially debugging with gdb? TIA

jart commented 2 years ago

Join our Discord #help channel and I'll mentor you in the art of C. Like you I have a background in Java (particularly Guava) so I could draw upon some of that experience to help clarify anything you need. https://discord.gg/FunsGsDG

JakeBamrah commented 8 months ago

Forgive me if this i a naïve question here. I've been looking into this (along with RFC6455) for the last few days. I am a beginner C programmer but would love to give this a shot (although I think it will take a few months). Could this be broken down into two sub-tasks:

  1. Implementing websocket logic, apis and tests
  2. Then integrating it into redbean and greenbean

or should these two tasks be worked on in tandem?

Edit: I see from jart's comment above that the websocket implementation can be tightly coupled with the server itself. Can I ask how the mechanics of websockets would be intertwined with the workings of the webserver? This might be too big of a question to answer but even an example would help me to understand this statement a little better.

pkulchenko commented 8 months ago

@JakeBamrah, there is an implementation being worked on in #967, so you may want to review and discuss it there.