Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (16 sloc) 600 Bytes
require 'rubygems'
require './lib/faye'
task :example, :port do |t, args|
system "rackup -s thin -E production -p #{args[:port]} examples/rack/"
task :handshake, :port, :n, :c do |t, args|
require 'cgi'
require 'json'
message = {:channel => '/meta/handshake',
:version => '1.0',
:supportedConnectionTypes => ['long-polling']}
message = CGI.escape(JSON.dump message)
url = "{args[:port]}/bayeux?jsonp=callback&message=#{message}"
puts "Request URL:\n#{url}\n\n"
system "ab -n #{args[:n]} -c #{args[:c]} '#{url}'"
Jump to Line
Something went wrong with that request. Please try again.