PageRenderTime 21ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/node-websocket-client/examples/client.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 10 lines | 9 code | 1 blank | 0 comment | 0 complexity | 30df83a446902b2e9670a635a1f258a7 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. var sys = require('sys');
  2. var WebSocket = require('../lib/websocket').WebSocket;
  3. var ws = new WebSocket('ws://localhost:8000/biff', 'borf');
  4. ws.addListener('data', function(buf) {
  5. sys.debug('Got data: ' + sys.inspect(buf));
  6. });
  7. ws.onmessage = function(m) {
  8. sys.debug('Got message: ' + m);
  9. }