Ruby SPDYSPDY 协议的 Ruby 语言实现
Ruby SPDY 是 SPDY 协议的 Ruby 语言实现。
示例代码:
sr = SPDY::Protocol::Control::SynReply.new
headers = {'Content-Type' => 'text/plain', 'status' => '200 OK', 'version' => 'HTTP/1.1'}
sr.create(:stream_id => 1, :headers => headers)
send_data sr.to_binary_s
# or, to send a data frame
d = SPDY::Protocol::Data::Frame.new
d.create(:stream_id => 1, :data => "This is SPDY.")
send_data d.to_binary_s
评论