Skip to content

Instantly share code, notes, and snippets.

@lauripiispanen
Created April 18, 2013 06:36
Show Gist options
  • Save lauripiispanen/5410636 to your computer and use it in GitHub Desktop.
Save lauripiispanen/5410636 to your computer and use it in GitHub Desktop.
Towtruck websocket data example
» curl -i -N -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: [hidden]" -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: hub.towtruck.mozillalabs.com" -H "Origin: https://towtruck.mozillalabs.com" http://hub.towtruck.mozillalabs.com/hub/[sessionId]
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: [A token]
Origin: https://towtruck.mozillalabs.com
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":1152,"offsetY":868,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":1103,"offsetY":766,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#codemirror-container","offsetX":769,"offsetY":161,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#codemirror-container","offsetX":769,"offsetY":149,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#ace-editor:nth-child(5)","offsetX":11,"offsetY":257,"clientId":"aKgBnNEpbn"}
{"type":"scroll-update","position":{"location":"body:nth-child(2):nth-child(1):nth-child(2):nth-child(1)","offset":1,"absoluteTop":162,"documentHeight":1381},"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":457,"offsetY":238,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":260,"offsetY":222,"clientId":"aKgBnNEpbn"}
{"type":"cursor-click","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":260,"offsetY":222,"clientId":"aKgBnNEpbn"}
{"nickname":"[nick1]","avatar":"data:image/png;base64,[base64-data]","color":"#c46ff","url":"https://towtruck.mozillalabs.com/example/code","urlHash":"","title":"Mozilla Labs : TowTruck example code editing","rtcSupported":true,"type":"hello","clientVersion":"unknown","starting":true,"clientId":"pqq1iV8svb"}
{"type":"scroll-update","position":{"location":"body:nth-child(2):nth-child(1)","offset":0,"absoluteTop":0,"documentHeight":1381},"clientId":"pqq1iV8svb"}
}{"nickname":"[nick2]","avatar":"data:image/png;base64,[base64-data]","color":"#970ed7","url":"https://towtruck.mozillalabs.com/example/code","urlHash":"","title":"Mozilla Labs : TowTruck example code editing","rtcSupported":true,"type":"hello-back","starting":true,"clientId":"aKgBnNEpbn"}
{"nickname":"[nick3]","avatar":"data:image/png;base64,[base64-data]","color":"#47cd50","url":"https://towtruck.mozillalabs.com/example/code","urlHash":"","title":"Mozilla Labs : TowTruck example code editing","rtcSupported":true,"type":"hello-back","clientId":"a9I6t14NpH"}
{"type":"cursor-update","element":"body:nth-child(2)","offsetX":10,"offsetY":474,"clientId":"a9I6t14NpH"}
{"type":"scroll-update","position":{"location":"body:nth-child(2):nth-child(1)","offset":0,"absoluteTop":0,"documentHeight":1381},"clientId":"a9I6t14NpH"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":260,"offsetY":222,"clientId":"aKgBnNEpbn"}
{"type":"scroll-update","position":{"location":"body:nth-child(2):nth-child(1):nth-child(2):nth-child(1)","offset":1,"absoluteTop":162,"documentHeight":1381},"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":58,"offsetY":328,"clientId":"a9I6t14NpH"}�D{"type":"cursor-update","top":246,"left":71,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":53,"offsetY":320,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","top":363,"left":212,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","top":569,"left":491,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","top":650,"left":655,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","top":636,"left":731,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","top":600,"left":773,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","top":586,"left":790,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","top":578,"left":797,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","element":"body:nth-child(2)","offsetX":58,"offsetY":160,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","top":574,"left":801,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1):nth-child(1):nth-child(1):nth-child(1):nth-child(5):nth-child(1)","offsetX":26,"offsetY":10,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","top":570,"left":806,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1):nth-child(1):nth-child(1):nth-child(1):nth-child(5):nth-child(1)","offsetX":106,"offsetY":10,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1):nth-child(1):nth-child(1):nth-child(1):nth-child(5):nth-child(1)","offsetX":229,"offsetY":8,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","top":567,"left":814,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":130,"offsetY":137,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":174,"offsetY":150,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","top":566,"left":817,"clientId":"pqq1iV8svb"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":150,"offsetY":110,"clientId":"a9I6t14NpH"}
{"type":"bye","clientId":"pqq1iV8svb"}
{"type":"cursor-click","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":139,"offsetY":93,"clientId":"a9I6t14NpH"}
{"type":"keydown","clientId":"a9I6t14NpH"}
{"type":"keydown","clientId":"a9I6t14NpH"}
{"type":"keydown","clientId":"a9I6t14NpH"}
{"type":"keydown","clientId":"a9I6t14NpH"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":130,"offsetY":93,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":18,"offsetY":258,"clientId":"a9I6t14NpH"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":220,"offsetY":183,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":200,"offsetY":151,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":197,"offsetY":150,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":124,"offsetY":132,"clientId":"aKgBnNEpbn"}
{"type":"cursor-update","element":"#ace-editor:nth-child(3):nth-child(1):nth-child(2)","offsetX":111,"offsetY":130,"clientId":"aKgBnNEpbn"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment