Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1008 unexpected data message: When using htmx client #460

Open
hmajid2301 opened this issue Jul 28, 2024 · 0 comments
Open

1008 unexpected data message: When using htmx client #460

hmajid2301 opened this issue Jul 28, 2024 · 0 comments

Comments

@hmajid2301
Copy link

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

image

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant