You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
390 B

require "option_parser"
require "./test-ws"
uri = "ws://localhost:1234/pong.JSON"
OptionParser.parse do |parser|
parser.on "-u uri", "--uri uri", "URI" do |opturi|
uri = opturi
end
parser.on "-h", "--help", "Show this help" do
puts parser
exit 0
end
end
begin
tws = TestWS.new uri
puts "connection done: closing it"
tws.close
tws.read
rescue e
puts "Exception: #{e}"
end