Sha256: b98f73bd16086cd3be73c8f26957038931b25b7f294f3134c187e9c9a7356f55
Contents?: true
Size: 547 Bytes
Versions: 6
Compression:
Stored size: 547 Bytes
Contents
#!/usr/bin/env coffee ## npm insatll socket.io-client coffee-script url = process.argv[2] or 'http://localhost:3000' socket = require('socket.io-client').connect url, {transports: ['websocket']} socket.on 'connect', -> console.log 'connect!!' socket.on 'disconnect', -> console.log 'disconnected' socket.on 'chat', (data) -> console.log "> " + data.msg process.stdin.setEncoding 'utf8' process.stdin.on 'data', (data) -> msg = data.replace(/[\r\n]/g, '') return if msg.length < 1 socket.emit 'chat', {msg: msg, at: Date.now()}
Version data entries
6 entries across 6 versions & 2 rubygems