Welcome to websockethub.com. Try out the groupchat, here on the right (click on it).
As a webmaster, to include a chatroom widget in your own page, put this in your HTML:
<script src="https://static.websockethub.com/chatroomwidget.js"></script>
As a visitor, to spawn a groupchat where there is none, use this bookmarklet: websockethub. Note: does not work on secure (SSL/TLS) websites (yet)!
Do you have the bookmarks toolbar enabled? It's a list of buttons with your bookmarks, just below the address bar, and it looks like this:
Yes? Then just drag this link somewhere in there: websockethub. Now, on any website, click on that button to join the chatroom.
Hold down CTRL and press B. Drag this link into that thing on the left: websockethub. Press CTRL + B again to close it. Now, on any website, open the thing and click the link. Bam! Chatroom.
PS: what is a good word for “that thing on the left”?
Press CTRL + SHIFT + B to enable the bookmarks toolbar, if it wasn't visible already. Drag this link into it: websockethub. On any website, click that bookmark button to join the chatroom.
The groupchat widget requires two things: a javascript file that builds it client-side, and a chatroom server for the communication. Websockethub.com provides both. The server is a simple hub, which echoes all incoming data to every other connected client. It works like an ethernet hub, hence the name.
Hubs are accessible at ws://hub.websockethub.com/hub?room=roomname (no SSL, yet). A name can be anything, but if it starts with http(s):// it will be listed in the public list of rooms.
The javascript hosting is easy (static file on S3) so we are confident that uptime will be good. The chatroom itself, not so much: it's a go server on a dedicated digitalocean droplet. Everything is kept in RAM. If it crashes, it will reboot, losing all chatrooms and associated backlog. Not acceptable for your demo? Download the code on github.com and host a service on your own server. Configure that chatroom widget by setting this variable before you include the script:
<script> var websockethub_chatroom_config = { // hostname of the websockethub server (default // "hub.websockethub.com") websockethost: "hub.somethingsomethingdarkside.com", // Name of the chatroom (default is current document // location, without query string) room: "myroom", // path of the hub on the server (default "/hub") websocketpath: "/hub", }; </script>
Source code is available at https://github.com/hraban/websockethub.
Websockethub.com was built by Hraban for release under the nobullshitsoftware.com umbrella. Feel free to drop us a line with your comments, or talk to us in the chatbox right here on this page. Enjoy!
Hraban Luyat <hraban@0brg.net>
2014