jart / cosmopolitan

build-once run-anywhere c library
ISC License
17.85k stars 612 forks source link

[Feature Request] [Redbean] Add libcurl to enable more advanced http/websocket client #1128

Open codehz opened 6 months ago

codehz commented 6 months ago

Use cases:

  1. Some API endpoint only allow HTTP/2.0: APNS
  2. Also websocket (with tls) client
  3. Send multiple request at same time (without forking)
  4. HTTP Request with streaming payload (+if allow get body chunk by chunk we can also build a reverse proxy)

Yes, I think some of those functions can be implemented in lua with unix module except for the tls support... but it is not ideal

also libcurl has permissive license, I think it should be compatible with cosmopolitan and redbean

jperon commented 1 week ago

Another use case would be ftp communication. I looked at the code of luasocket ftp to see whether I’d manage mocking something like @pkulchenko suggested, but I fear it’s beyond my skills!