We made the Go Snowflake proxy run in a browser

There is no easy-to-install version for normal users yet though. If you want to try it out, you’ll need to build it from source (all you need is install Go). See the proxy/README.md file in the merge request:

But yeah, it’s working:

For those who are not aware, the current Snowflake extension does not use WASM. That’s a pure JS implementation.

Porting to WASM was surprisingly easy. The changes to the code base are fairly minimal. The behavior of the standalone proxy version (not WASM) is not affected by the MR.

The WASM build of the proxy uses the browser’s built-in WebSocket and WebRTC classes.

The .wasm file ends up 16M (megabytes) in size. Maybe TinyGo could help with reducing the size, but I don’t know if it requires much work. Maybe the Pion and the coder/websocket libraries are not compatible with TinyGo.

Snowflake maintainers stated that they may consider migrating the original Snowflake extension to this WASM version. This has been discussed on the previous anti-censorship meeting.

Though I’m noticing something that looks like a memory leak, so work is still due.
According to the browser’s task manager, it takes up 130,000K, and grows slowly over time. Maybe a simple restart every 24 hours would be good enough for a start.
For comparison, with the original Snowflake extension it’s ~40,000K.
CPU usage also seems higher.

If you’re interested why I worked on this: I’m working on a fork of Snowflake (see Snowflake, but faster thanks to not using Tor), and I decided that it’d probably be easier to port the Go version to WASM than it would be to port my changes to the Go proxy code to the JavaScript version of Snowflake proxy.

I got the idea of running the Go version of Snowflake in the browser from the Lantern’s Unbounded project where they also use Pion.

I would like to thank DavidSM100 (David) · GitHub for the initial WASM Snowflake proxy prototype; albrow (Alex Browne) · GitHub for implementing WASM support in Pion and all other Pion contributors, especially Sean-Der (Sean DuBois) · GitHub; and, of course, the Snowflake maintainers, for making all this such a breeze to implement!

1 Like