Comments (1)
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)
- Gputil Failed to initialize NVML: Unknown Error HOT 1
- websocketd with django views HOT 1
- How can I use c/c++ as a websocket client rather than server? HOT 2
- Seg fault 11 on M1 Max
- system(); in g++(C++) seems invalid
- Pipe multiple CLI apps to generate a website
- any way to handle the DISCONNECT message ?
- New option for binary websockets
- The wiki has been edited to have a links to ransomware. HOT 2
- Fix wiki
- MIPS compilation?!?
- bash script running on websocketd can't connect to dbus HOT 3
- Ten minute tutorial - confusing HOT 7
- Have you meet websocketd broken automatically ? HOT 1
- how to get a response like 'Clean: true, ..' after script executed HOT 6
- Vulnerability of dependency "github.com/gorilla/websocket"
- nodejs handle process.stdin incorrect HOT 1
- Issues with newlines
- How to change framesize?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from websocketd.