Git Product home page Git Product logo

Comments (1)

JeffRossMT avatar JeffRossMT commented on June 2, 2024

I added a smidgen of debugging with the following patch:

--- libwebsocketd/websocket_endpoint.go	Mon Feb 21 12:54:44 2022
+++ libwebsocketd/websocket_endpoint.go.mod	Mon Feb 21 13:14:14 2022
@@ -71,7 +71,8 @@
 			break
 		}
 		if mtype != we.mtype {
-			we.log.Debug("websocket", "Received message of type that we did not expect... Ignoring...")
+			we.log.Debug("websocket", "Received message of type %d that we did not expect instead of %d... Ignoring...",mtype,we.mtype)
+			we.log.Debug("websocket", "Received message of unknown type: %d", mtype)
 		}

 		p, err := ioutil.ReadAll(rd)

Didn't help a lot, though--here's what I get from the debug log after the patch:

Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: SERVER_SOFTWARE=websocketd/v0.3.1 (go1.15.2 openbsd-amd64) --
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Parent envvar: PATH=/home/jross/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/etc/scripts/.
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: REMOTE_ADDR=154.27.106.60
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: REMOTE_HOST=154.27.106.60
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: SERVER_NAME=starhouse-observatory.org
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: SERVER_PORT=9001
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: SERVER_PROTOCOL=HTTP/1.1
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: GATEWAY_INTERFACE=websocketd-CGI/0.1
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: REQUEST_METHOD=GET
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: SCRIPT_NAME=/
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: PATH_INFO=/mqtt
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: PATH_TRANSLATED=/mqtt
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: QUERY_STRING=
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: AUTH_TYPE=
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: CONTENT_LENGTH=
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: CONTENT_TYPE=
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: REMOTE_IDENT=
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: REMOTE_USER=
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: UNIQUE_ID=1645475578197867527
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: REMOTE_PORT=58338
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: REQUEST_URI=/mqtt
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Std. variable: HTTPS=on
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_ACCEPT=*/*
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_WEBSOCKET_PROTOCOL=mqttv3.1
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_WEBSOCKET_EXTENSIONS=permessage-deflate
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_FETCH_SITE=same-site
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_ACCEPT_LANGUAGE=en-US,en;q=0.5
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_ACCEPT_ENCODING=gzip, deflate, br
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_WEBSOCKET_VERSION=13
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_DNT=1
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_CONNECTION=keep-alive, Upgrade
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_FETCH_MODE=websocket
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_USER_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_ORIGIN=https://www.starhouse-observatory.org
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_PRAGMA=no-cache
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_WEBSOCKET_KEY=Attp86tOm6Hlp8foZrxI2A==
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_FETCH_DEST=websocket
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_SEC_GPC=1
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_CACHE_CONTROL=no-cache
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | env        | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' | Header variable HTTP_UPGRADE=websocket
Mon, 21 Feb 2022 13:32:58 -0700 | ACCESS | session    | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' | CONNECT
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | websocket  | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' pid:'30738' | Received message of type 2 that we did not expect instead of 1... Ignoring...
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | websocket  | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' pid:'30738' | Received message of unknown type: 2
Mon, 21 Feb 2022 13:32:58 -0700 | ERROR  | process    | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475548662208639' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' pid:'84317' | Unexpected error while reading STDOUT from process: read |0: file already closed
Mon, 21 Feb 2022 13:32:58 -0700 | ERROR  | process    | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475548662208639' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' pid:'84317' | Unexpected error while reading STDERR from process: read |0: file already closed
Mon, 21 Feb 2022 13:32:58 -0700 | DEBUG  | process    | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475548662208639' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' pid:'84317' | Process 84317 terminated after SIGKILL
Mon, 21 Feb 2022 13:32:58 -0700 | ACCESS | session    | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475548662208639' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' pid:'84317' | DISCONNECT
Mon, 21 Feb 2022 13:33:27 -0700 | DEBUG  | websocket  | url:'https://starhouse-observatory.org:9001/mqtt' id:'1645475578197867527' remote:'154.27.106.60' command:'./mosquitto_sub.sh' origin:'https://www.starhouse-observatory.org' pid:'30738' | Cannot receive: websocket: close 1005 (no status)
Mon, 21 Feb 2022 13:33:27 -0700

What I don't know is what a message of type 2 is and how do I convert the output of mosquitto_sub to a message of type 1? I did try piping the output of mosquitto_sub through strings but that made no change.

Jeff

from websocketd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.