Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

Websockets Support? #70

Closed
bitdivision opened this issue Jan 30, 2018 · 6 comments
Closed

Websockets Support? #70

bitdivision opened this issue Jan 30, 2018 · 6 comments

Comments

@bitdivision
Copy link

Is there any plan for supporting MQTT over websockets in the future?

@tekjar
Copy link

tekjar commented Jan 31, 2018

@bitdivision No plan yet

@bitdivision
Copy link
Author

Would you be open to accepting a pull request for it?

I'm assuming that most of the effort at the moment is focused on async? If so should I be implementing this against one of those branches.

Any suggestions as to how to go about this?

@tekjar
Copy link

tekjar commented Feb 1, 2018

@bitdivision Ofcourse. PRs are always welcome. All the work is happening on tokio2 branch. Please work on top of that.

@bitdivision
Copy link
Author

@tekjar - I tried to get in touch with you on gitter, but I don't think you saw it.

I'm attempting to integrate https://github.com/snapview/tokio-tungstenite to provide websockets support and falling at the first hurdle. Perhaps @agalakhov could help with this too.

What I'd like to do is add WebSocketStream to the NetworkStream enum, so that it can be used in the same way it currently is. I'm unable to do this as it doesn't support AsyncRead and I'm not sure how I would go about implementing Read for it.

As far as I can tell, the WebSocketStream struct is essentially the equivalent of Framed, but obviously I'm unable to set decoders and encoders for it. I'll create an issue there too and see if they have any suggestions.

Any ideas on how I can do this, or if I'm missing something obvious?

@tekjar
Copy link

tekjar commented Feb 7, 2018

@bitdivision My knowledge is almost close to zero w.r.t websockets. But connect_async seems to be a wrapper over tokio tcpstream. I'm not sure of the reason why asyncread isn't available. I'd like to learn more about websockets and try this out but I'll be busy this month. Maybe you can fork this out and try without Networkstream?

@bitdivision
Copy link
Author

@tekjar - Yeah, I'm going to try some different libraries and see if there's a more appropriate interface available, but if not, I'll try to get a proof of concept together by hacking all your code apart.

@tekjar tekjar closed this as completed Oct 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants