Sha256: df87f8336f7e912f43bab72c7ddc2a3b5f6a268324a801bab0f1e11683feb5c1
Contents?: true
Size: 521 Bytes
Versions: 8
Compression:
Stored size: 521 Bytes
Contents
#!/usr/bin/env ruby $:.unshift File.expand_path '../lib', File.dirname(__FILE__) require 'rubygems' require 'websocket-client-simple' puts "websocket-client-simple v#{WebSocket::Client::Simple::VERSION}" url = ARGV.shift || 'ws://localhost:8080' ws = WebSocket::Client::Simple.connect url ws.on :message do |msg| puts ">> #{msg.data}" end ws.on :open do puts "-- websocket open (#{ws.url})" end ws.on :close do |e| puts "-- websocket close (#{e.inspect})" exit 1 end loop do ws.send STDIN.gets.strip end
Version data entries
8 entries across 8 versions & 1 rubygems