1008 unexpected data message: When using htmx client
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, javascript
- Domain
- backend, networking
Research direction
Reproduce with the banterbus repository at commit 9bcd9d73690df9cd3fdcddafc4498a1428497210, run go run main.go, and submit “Create Room” from Firefox with htmx 2.0. Start by reading internal/transport/http.go and comparing it with the working gobwas/ws commit. Inspect the WebSocket network response to isolate the 1008 or RSV error; done means the cause is identified and the htmx reproduction works or has clear guidance.
Written by the indexing model from the issue text.
Description
Hi,
I seem to be having issues using this library when using it htmx as the client, specifically version 2 of htmx. I am also testing this on Firefox (if browser may make a difference.
I tend to see either this error Connection Closed: 1008 unexpected data message or sometimes I see Invalid RSV bits ....
I am not sure how to debug what is going on. But I noticed there was another issue where someone getting similar errors in issue #339.
I tried using another library, https://github.com/gobwas/ws, and it seems to work with this library 🤔. See this commit here for an example where it works: https://gitlab.com/hmajid2301/banterbus/-/commit/a7501484832f51f430e83da1e39dacd01a0b6860.
See this commit here for a version with this library causing issues: https://gitlab.com/hmajid2301/banterbus/-/blob/9bcd9d73690df9cd3fdcddafc4498a1428497210/internal/transport/http.go
Please let me know if there is anything I can do to help ❤️ .
Reproduce
git clone https://gitlab.com/hmajid2301/banterbus.git
git checkout 9bcd9d73690df9cd3fdcddafc4498a1428497210
go run main.go
# Go to localhost:8080
- Try to submit the input
Create Room - Inspect network traffic
- Notice the error in the response
- Of the web socket request
Version
cat go.mod
# ...
nhooyr.io/websocket v1.8.11
cat index.html
#
https://unpkg.com/htmx.org@2.0.0
https://unpkg.com/htmx-ext-ws@2.0.0/ws.js
firefox --version
Mozilla Firefox 128.0
- Dominant language
- Go
- Stars
- 5.5k
- Forks
- 377
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/websocket
-
Must not wrap io.EOF Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
export wstest Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
Similar issues
-
feature-request helm
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gravitational/teleport#69785 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
crossplane/crossplane#7859 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100