getlantern / browsersunbounded

Interoperable browser-based P2P proxies for censorship circumvention
GNU General Public License v3.0
11 stars 0 forks source link

JavaScript newBroflake constructor should match the function signature of the native binary constructor #134

Open noahlevenson opened 1 year ago

noahlevenson commented 1 year ago

We initially avoided this because it's a lot of boilerplate to pass JS objects which match BroflakeOptions, WebRTCOptions, and EgressOptions and validate their structure. There was no need to write all that back when we were happy to use nearly everything in the default structures.

Today, though, things are changing. As of March 30, 2023, we're forcibly overriding 10 fields across those 3 configuration structures. It's probably time to clean this up.

The big brained approach: add JavaScript constructors to create JS counterparts to NewDefaultBroflakeOptions, NewDefaultWebRTCOptions, and NewDefaultEgressOptions.