Get the latest tech news

Making Libcurl Work in WebAssembly


We explain how to make libcurl based applications work in webassembly without changes by tunneling all traffic over a websocket proxy.

However it turns out there is a relatively simple way to make existing code work in WebAssembly, by letting libcurl route all traffic over a websocket based proxy server. If you have existing TCP networking code written in C/C++ that utilizes the Posix Sockets API, by default Emscripten attempts to emulate such connections to take place over the WebSocket protocol instead. This is a bit unfortunate because most browsers nowadays silently block http requests from webapps served on a https webpage due to mixed content security policies.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of WebAssembly

WebAssembly

Photo of Libcurl Work

Libcurl Work

Related news:

News photo

MichiganTypeScript: A WebAssembly runtime implemented in TypeScript types

News photo

Run Ruby on Rails in the browser using WebAssembly

News photo

Zeroperl: Sandboxing Perl with WebAssembly