Project

websocker

0.0
No commit activity in last 3 years
No release in over 3 years
A simple implementation of a Websocket client.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

websocker¶ ↑

simple (incomplete) websocket client implemtation…

sample usage:

ws = Websocker::Client.new(:host => "localhost", :port => 8887)
ws.connect
# listen for messages from the server
ws.on_message do |msg|
  puts "Received: #{msg}"
  # send a message
  ws.send("This is message ##{msgid}")
end
ws.on_closed do
  puts "Closed!"
end
# start listening
thrd = ws.listen
# wait until the connection is closed
thrd.join