getlantern / browsersunbounded

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

Replace JSON with Protocol Buffers #7

Open noahlevenson opened 1 year ago

noahlevenson commented 1 year ago

For the sake of rapid prototyping, clients and Freddie currently speak to each other using JSON as an interchange format. We must use Protocol Buffers instead.

This is pretty important. Since we always planned to swap in Protobufs, you'll notice plenty of JSON serialization/deserialization code that is particularly grotesque and placeholder-y.

oxtoacart commented 1 year ago

Why "must" we use Protocol Buffers?

noahlevenson commented 1 year ago

Oh, it's not the 11th commandment. During design phase, folks said we should use protocol buffers. I didn't use protocol buffers during prototyping because it was faster to do JSON. My intention with this ticket was just to honor the group consensus. But if you don't think we must use Protocol Buffers, it's not consensus!

oxtoacart commented 1 year ago

I think protocol buffers has some advantages for sure. I guess given that you're not happy with the state of the JSON processing, we might as well get in there and do protocol buffers.