From 8f118a358cc10745c5a784578d0e9c5037529179 Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Sat, 10 Aug 2024 15:07:05 +0200 Subject: [PATCH] wsproxy now giving a more friendly error message when there is a protocol mismatch describing what the user should do. --- cmd/wsproxy/wsproxy.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/wsproxy/wsproxy.go b/cmd/wsproxy/wsproxy.go index d2ed03b..8cf1f81 100644 --- a/cmd/wsproxy/wsproxy.go +++ b/cmd/wsproxy/wsproxy.go @@ -115,14 +115,15 @@ func main() { if !raw { channel := comms.NewGOBChannel(wsConn) // receive protocol version - protocolVersion, err := comms.ReceiveWithTimeout[comms.ProtocolVersion](channel) + serverProtocol, err := comms.ReceiveWithTimeout[comms.ProtocolVersion](channel) if err != nil { log.Printf("Error receiving protocol version %v", err) os.Exit(1) } - if protocolVersion.Version != comms.PROTOCOL_VERSION { + if serverProtocol.Version != comms.PROTOCOL_VERSION { log.Printf("Protocol version mismmatch: client %d, server %d", - comms.PROTOCOL_VERSION, protocolVersion.Version) + comms.PROTOCOL_VERSION, serverProtocol.Version) + log.Println("Download a compatible version of 'wsproxy' from the server to fix this issue. ") os.Exit(1) } // receive confirmation about the agent id.