Sha256: 798b57da9733c3e1d02e80b855866b4d21761c04470b7da18353cc70f1b6f824

Contents?: true

Size: 393 Bytes

Versions: 4

Compression:

Stored size: 393 Bytes

Contents

#!/usr/bin/env ruby

require 'async'
require 'async/io/stream'
require 'async/http/endpoint'
require 'async/websocket/client'

URL = ARGV.pop || "http://127.0.0.1:7070"

Async do |task|
	endpoint = Async::HTTP::Endpoint.parse(URL)
	
	Async::WebSocket::Client.connect(endpoint) do |connection|
		connection.write ["Hello World"]
		
		while message = connection.read
			p message
		end
	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
async-websocket-0.13.1 examples/rack/client.rb
async-websocket-0.13.0 examples/rack/client.rb
async-websocket-0.12.2 examples/rack/client.rb
async-websocket-0.12.1 examples/rack/client.rb