<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>This puts the password in plain text if you are not using https:</div><div><br></div><div><blockquote type="cite"><div>{username: 'myname', password: 'mypassword'}</div></blockquote><br></div><div>Hookbox has a nice way of passing the authentication, by using a combination of the username and a session cookie.</div><div>When you authenticate with hookbox, you get a web callback passing the session cookie id with the username which of course</div><div>your web application should know about as it generated the session cookie, and can map it to the username and can then allow</div><div>or deny the request..</div><div><br></div><div>Downside is of course that you have to provide this mechanism in your web application.</div><div><br></div><div>Tim.</div><br><div><div>On 5 Nov 2010, at 09:55, Miguel Morales wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hmm, I can think of two ways for authentication. &nbsp;Appending it to the<br>url (not sure if it's possible):<br>var ws = new WebSocket("<a href="ws://4.2.2.2:123?username=myname&amp;password=mypassword">ws://4.2.2.2:123?username=myname&amp;password=mypassword</a>");<br><br>Not sure if you can properly handle errors this way. &nbsp;Another way<br>would be something like:<br><br>var ws = new WS(...);<br>//attemp to login....<br>ws.send({username: 'myname', password: 'mypassword'});<br>//... check if it worked, maybe get an auth token?<br><br><br>On Fri, Nov 5, 2010 at 1:49 AM, Tim Child &lt;<a href="mailto:tim@cantemo.com">tim@cantemo.com</a>&gt; wrote:<br><blockquote type="cite">And authentication?<br></blockquote><blockquote type="cite">Seems to me that you should consider some form of authentication against the<br></blockquote><blockquote type="cite">service, whether it is some sort of REST callback to another service or some<br></blockquote><blockquote type="cite">other mechanism.<br></blockquote><blockquote type="cite">Tim.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 5 Nov 2010, at 09:00, Michael Bridgen wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">var message = new Object(); message.command = "publish";<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">message.queue = "myqueue"; message.exchange = "myexchange";<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">message.key = "mybindkey"; message.body = "hello world";<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">var message_json = JSON.stringify(message);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">var ws = new WebSocket("<a href="ws://4.2.2.2:123">ws://4.2.2.2:123</a>"); ws.send(message_json);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Consuming:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">var subscribe = new Object(); subscribe.command = "consume";<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">subscribe.queue = ...<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">ws.send(subscribe_json);<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">//wait for reply from server... ws.onopen = function(event) {<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">//handle message or error here.. }<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">How about something /really/ simple:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">var sock = new RabbitSocket("subscribe", "myexchange");<br></blockquote><blockquote type="cite">sock.onMessage(function(msg) {<br></blockquote><blockquote type="cite">&nbsp;...<br></blockquote><blockquote type="cite">});<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">and perhaps more provocatively,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">var sock = new RabbitSocket("request", "myqueue");<br></blockquote><blockquote type="cite">sock.send("question");<br></blockquote><blockquote type="cite">sock.onMessage(function(answer) {<br></blockquote><blockquote type="cite">&nbsp;...<br></blockquote><blockquote type="cite">});<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">or even<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">sock.request("question", function(answer) {<br></blockquote><blockquote type="cite">&nbsp;...<br></blockquote><blockquote type="cite">});<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This is a bit more like how our STOMP adapter works (now, on<br></blockquote><blockquote type="cite">default branch[1]), and more like the much admired ZeroMQ. &nbsp;I've been<br></blockquote><blockquote type="cite">messing around with this kind of model at<br></blockquote><blockquote type="cite"><a href="https://github.com/squaremo/rabbit.js#readme">https://github.com/squaremo/rabbit.js#readme</a>.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">[1] <a href="http://hg.rabbitmq.com/rabbitmq-stomp/file/0aff7391968a/DESIGN.md">http://hg.rabbitmq.com/rabbitmq-stomp/file/0aff7391968a/DESIGN.md</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Michael.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I don't need STOMP support, the websocket plugin should just require<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">a port for communication and delegate the commands to rabbitmq.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Thu, Nov 4, 2010 at 10:47 AM, Christian Legnitto<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">&lt;<a href="mailto:clegnitto@mozilla.com">clegnitto@mozilla.com</a>&gt; &nbsp;wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Nov 4, 2010, at 10:26 AM, Marek Majkowski wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Fri, Oct 29, 2010 at 19:55, Christian<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Legnitto&lt;<a href="mailto:clegnitto@mozilla.com">clegnitto@mozilla.com</a>&gt; &nbsp;wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">[...] Support for WebSockets<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">* It'd be nice for there a plugin to support websockets * More<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">important for Mozilla as most tools are web-based * I have set<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">it up with orbitd, but it's a pain / another moving piece /<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">easier to uncomment a line like<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="http://activemq.apache.org/websockets.html">http://activemq.apache.org/websockets.html</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Christian,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'm interested in creating a websockets plugin for Rabbit.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">But I'm not really sure how you'd like to use it.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">As a thing exposed to the wild internet? Or just as another<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">framing for AMQP? Or as a wire protocol for STOMP? (like this<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">thing <a href="http://jmesnil.net/stomp-websocket/doc/">http://jmesnil.net/stomp-websocket/doc/</a>)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Or maybe you have yet another use case?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Cheers, Marek<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I was thinking more like <a href="http://jmesnil.net/stomp-websocket/doc/">http://jmesnil.net/stomp-websocket/doc/</a>,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">as that's what I have been using. Of course, the more options the<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">merrier :-) I can't really provide erlang help, but I'm sure I can<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">poke the WebSocket guys here at Moz to provide any assistance<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">required on that front.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks, Christian _______________________________________________<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">rabbitmq-discuss mailing list <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">rabbitmq-discuss mailing list<br></blockquote><blockquote type="cite"><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br></blockquote><blockquote type="cite"><a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Tim Child<br></blockquote><blockquote type="cite">+46 (0) 7602 17785<br></blockquote><blockquote type="cite">Skype: timchild<br></blockquote><blockquote type="cite"><a href="http://www.cantemo.com">http://www.cantemo.com</a><br></blockquote><blockquote type="cite">CANTEMO<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">rabbitmq-discuss mailing list<br></blockquote><blockquote type="cite"><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br></blockquote><blockquote type="cite"><a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><br><br><br>-- <br>~ Jeremiah:9:23-24<br>Android 2D MMORPG: <a href="http://developingthedream.blogspot.com/">http://developingthedream.blogspot.com/</a>,<br><a href="http://www.youtube.com/user/revoltingx">http://www.youtube.com/user/revoltingx</a><br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Tim Child</div><div>+46 (0) 7602 17785</div><div>Skype: timchild</div><a href="http://www.cantemo.com">http://www.cantemo.com</a><br></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 18px/normal Verdana; color: rgb(15, 83, 103); "><span style="color: rgb(251, 10, 19); ">C</span>ANTEMO</div></div></span></div></span></div></span></span></span></span></span></span></span></span></span></span></span></span></span></span></div></span></div></span></span>
</div>
<br></body></html>