From ff893945e9e460a2f75a5c3cbe426a5f586395f1 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Tue, 30 Dec 2025 21:12:44 -0600 Subject: [PATCH] feat: add WebSocketInterface support and configure Quad4 WebSocket in main.go --- cmd/reticulum-go/main.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/reticulum-go/main.go b/cmd/reticulum-go/main.go index 4bc2222..2a71b31 100644 --- a/cmd/reticulum-go/main.go +++ b/cmd/reticulum-go/main.go @@ -193,6 +193,12 @@ func NewReticulum(cfg *common.ReticulumConfig) (*Reticulum, error) { ) case "AutoInterface": iface, err = interfaces.NewAutoInterface(name, ifaceConfig) + case "WebSocketInterface": + wsURL := ifaceConfig.Address + if wsURL == "" { + wsURL = ifaceConfig.TargetHost + } + iface, err = interfaces.NewWebSocketInterface(name, wsURL, ifaceConfig.Enabled) default: debug.Log(debug.DEBUG_CRITICAL, "Unknown interface type", common.STR_TYPE, ifaceConfig.Type) continue @@ -315,6 +321,13 @@ func main() { TargetPort: common.NUM_4242, Name: "Quad4 TCP", } + + cfg.Interfaces["Quad4 WebSocket"] = &common.InterfaceConfig{ + Type: "WebSocketInterface", + Enabled: true, + Address: "wss://socket.quad4.io/ws", + Name: "Quad4 WebSocket", + } } r, err := NewReticulum(cfg) @@ -639,7 +652,6 @@ func (r *Reticulum) createNodeAppData() []byte { } // Element 1: Int32 timestamp (current time) - // Update the timestamp when creating new announcements r.nodeTimestamp = time.Now().Unix() appData = append(appData, common.HEX_0xD2) // int32 format timeBytes := make([]byte, common.FOUR)