moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 508 forks source link

Add a web client for MQTT-over-Websocket #87

Open mcollina opened 10 years ago

mcollina commented 10 years ago

We can include the code in https://github.com/hivemq/hivemq-mqtt-web-client, it's apache licensed.

vyasashish commented 10 years ago

Hi, First of all thanks for such a wonderful initiative. Well I have been using your broker to work with mqtt based client like android etc.Now I want to use it for web-browser. As,it requires a websocket client so in mosca i have found a client server code which uses mows.js to connect to any websocket server.

Now if that is the case then I need to run a seperate websocket server and a seperate Mqtt broker to cater android and web browser client. My question is : Is there a way in which we can run just one mqtt broker which caters to both mqtt and websocket.

I would appreciate if some one can give some pointers in this regards.

Thanks

mcollina commented 10 years ago

You can have Mosca listen on multiple ports, or you can attach Mosca to your own HTTP server. The test server at test.mosca.io is working in both modes.

vyasashish commented 10 years ago

Thanks a lot that helped.Appreciate it.

roccomuso commented 8 years ago

Old issue but, what do you meant initially with "add a web client"? you mean a client with a cool UI?

mcollina commented 8 years ago

Yes, something to publish and subscribe to the broker and do general debugging.

roccomuso commented 8 years ago

Hmm I could work on that, should it have a basic UI or we're looking for something cool to see? material design etc..

mcollina commented 8 years ago

If you are into polymer, you can try https://github.com/mqttjs/mqtt-elements.

Basic UI, and you can also leverage from mqttlens (https://github.com/sandro-k/MQTTLensChromeApp) by @sandro-k.

mcollina commented 8 years ago

Anyway, any help is very welcomed!

mcollina commented 8 years ago

(or something react-based is fine too!)

sandro-k commented 8 years ago

I am trying to find some time to update MQTTLens to the mqtt-elemets and polymer 1.0. Maybe that can help you.

YasserTahri commented 7 years ago

I have used mqtt for web client but i hve this error message: failed: Error during WebSocket handshake: Unexpected response code: 200 !!!!!

sandro-k commented 7 years ago

@YasserTahri Please open up a new issue and explain your problem in more depth there.