wsproxy now giving a more friendly error message when there is a protocol mismatch describing what the user should do.
This commit is contained in:
parent
7f6fa31c8a
commit
8f118a358c
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user