Libcurl and WebSockets

"Gavin D. Howard via curl-library" <[email protected]>
Newsgroups gmane.comp.web.curl.library
Message-ID <EviBjSnB_bp46mungsCJ5-I29m4t2cGbKm9OBSGRr79ol-5Ptf5ml4qINczsz4DRysEelyjMAwjwYAwZ1resHA_o-WUP0EvI7IHtDBxU_DU=@yzena.com>
Hello,

I am looking to use libcurl for a VCS. I will use the HTTP client and
email protocols, as well as the URL parser on both ends because Daniel
said so. [1]

I also intend to use WebSockets, and one thing I noticed in the RFC is
that WebSockets are more symmetrical than HTTP. In fact, after the
upgrade portion, which I will put in my own code, the only difference I
could find is masking.

Since I need to use libcurl on the server for URL parsing, I want to use
libcurl for the server portion of WebSockets. Libcurl does have the raw
API, so I already can, but that would mean duplicating the WebSocket
parsing.

I was wondering if the server portion of WebSockets could be
implemented minus the upgrade. I'd love to do it myself; would it be
accepted if I did it up to the standards of the Curl project?

On that note, I know that no portions of server code for HTTP will not
be implemented [2], and I agree. That said, I do need an HTTP server.

I've read the RFCs and just for HTTP 1.1, it seems simple enough to
implement it if I break Postel's law and essentially only accept
well-formatted HTTP requests, or requests as generated by browsers and
libcurl. Would it be simple enough to do myself? I really don't want to
pull in a full server library.

As a note: one requirement of my server is that it will always be run
behind a reverse proxy, so I don't have to worry about TCP and other
complexities. So when I say "just for HTTP 1.1," I really do mean it: I
just need HTTP 1.1 request parsing and response generation. I think.

As experts in HTTP, could I do that myself without too much trouble?

Gavin D. Howard
Member and Manager
Yzena, LLC

PS: I would love to discuss design for the server portion of WebSockets,
but my first thought is to duplicate the current API to make the the use
more explicit.

[1]: https://daniel.haxx.se/blog/2022/01/10/dont-mix-url-parsers/
[2]: https://curl.se/docs/faq.html#Can_I_write_a_server_with_libcur
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.