Sha256: 67d9bbe596c0f9a7c333378078fe881b85c19a94488221cd25a61ef459964819
Contents?: true
Size: 347 Bytes
Versions: 2
Compression:
Stored size: 347 Bytes
Contents
#!/usr/bin/env ruby fork { load 'rpc.rb' exit 0 } require 'rubygems' require 'sinatra' require 'msgpack/rpc' rpc_port = 18800 $ws = MessagePack::RPC::Client.new('127.0.0.1', rpc_port) get '/' do erb :rpc end post '/push' do data = {'Hello'=>'World!', 'data' => params} $ws.call(:push_data, data) redirect '/', 303 end set :port, 8080
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
cool.io-websocket-0.1.4 | examples/rpc |
rev-websocket-0.1.3 | examples/rpc |