1
0
mirror of https://github.com/schollz/croc.git synced 2024-12-11 06:35:01 +03:00

recipient websockets should check for errors

This commit is contained in:
Zack Scholl 2018-10-22 19:41:50 -07:00
parent 6a07e1538d
commit ea9aa3f8ec

View File

@ -426,6 +426,9 @@ func (cr *Croc) receive(forceSend int, serverAddress string, tcpPorts []string,
for {
// read from websockets
websocketMessageData := <-websocketMessages
if bytes.HasPrefix(websocketMessageData.message, []byte("error")) {
return fmt.Errorf("%s", websocketMessageData.message)
}
if websocketMessageData.messageType != websocket.BinaryMessage {
continue
}