feat: Add protobuf (#171)

This is a second attempt to add protobuf to Nestri, after the first one
failed

---------

Co-authored-by: Philipp Neumann <3daquawolf@gmail.com>
Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
This commit is contained in:
Wanjohi
2025-01-29 04:16:27 +03:00
committed by GitHub
parent be6ea11052
commit c2363b0bce
42 changed files with 3114 additions and 854 deletions

View File

@@ -1,6 +1,7 @@
package relay
import (
"encoding/json"
"github.com/gorilla/websocket"
"log"
"net/http"
@@ -81,7 +82,7 @@ func wsHandler(w http.ResponseWriter, r *http.Request) {
// Assign message handler for join request
ws.RegisterMessageCallback("join", func(data []byte) {
var joinMsg MessageJoin
if err = DecodeMessage(data, &joinMsg); err != nil {
if err = json.Unmarshal(data, &joinMsg); err != nil {
log.Printf("Failed to decode join message: %s\n", err)
return
}