Closed sangupta closed 3 years ago
Cosmopolitan makes it possible to implement a 100 line of code HTTP curl command that works on all systems:
Cosmopolitan provides all the low-level system primitives you need. It should be possible to build higher level libraries like libcurl and openssl on top of Cosmopolitan too. Feel free to file bug reports if you encounter issues which prevent that from happening. Anything else, I'll make your dreams come true if Adobe considers sponsoring this project. https://github.com/sponsors/jart
Oh it's also worth mentioning that there's an HTTP server example using Cosmopolitan too! Check out redbean which can serve 1 million+ gzip encoded responses per second on a cheap personal computer. redbean makes it possible to share web applications that run offline as an single-file executable zip archive which contains your assets.
@jart Thanks for the examples. I am loving my very limited play as I get to refresh coding in C.
I am a Java developer but been exploring C++/vlang/go as a hobby lately for cross platform CLI tools that increase my own productivity. Is there an example, or a plan to add Http call support to cosmopolitan, or a way I could use libcurl to achieve the same (In my limited knowledge, I believe libcurl is available for all platforms). Guidance on how to get it working will help.
I do see
net
module/package, as well as functions likerecv
to connect over network, but am looking for a higher-level construct/example.Thanks.