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

Add support for wasm by switching to nhooyr/websocket library. #583

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Bluebugs
Copy link

This is only working at the moment with go wasm port and it is my main interest. Nhooyr websocket library allow also for simplifying NewWebsocket code.

gopherjs doesn't work for some weird interaction with the token logic channel, but it was beyond my goal with this PR and might require people with better knowledge about gopherjs.

@MattBrittan
Copy link
Contributor

MattBrittan commented Jan 26, 2022

This is a fairly large change to meet a relatively niche need so I'd appreciate it if you could raise an issue so this change is more visible and can be discussed.

Note that you can accomplish this without changes to the library by using the new ClientOptions.SetCustomOpenConnectionFn to use provide your own custom method for establishing a connection.

I don't personally use MQTT over websockets so am somewhat ambivalent re the change. However I do note that github.com/gorilla/websocket has been looking for a new maintainer for a couple of years (but issues are still being handled and PR's merged ). I had some initial concerns re the number of dependencies nhooyr/websocket introduces but it does look like the vast majority of these are for the tests only.

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

Successfully merging this pull request may close these issues.

3 participants