diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..6d775ff --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'http', github: 'tarcieri/http' +gem 'reel', github: 'celluloid/reel' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..5a4be38 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,37 @@ +GIT + remote: git://github.com/celluloid/reel.git + revision: dba5c521b8f4ad6509c3634d5aa1c4adc8c9ec4c + specs: + reel (0.5.0.pre) + celluloid (>= 0.15.1) + celluloid-io (>= 0.15.0) + http (>= 0.6.0.pre) + http_parser.rb (>= 0.6.0) + websocket_parser (>= 0.1.6) + +GIT + remote: git://github.com/tarcieri/http.git + revision: af63d6a01dbd8650ae8fb6237e9ffcd22d36cd7a + specs: + http (0.6.0) + http_parser.rb (~> 0.6.0) + +GEM + remote: https://rubygems.org/ + specs: + celluloid (0.15.2) + timers (~> 1.1.0) + celluloid-io (0.15.0) + celluloid (>= 0.15.0) + nio4r (>= 0.5.0) + http_parser.rb (0.6.0) + nio4r (1.0.0) + timers (1.1.0) + websocket_parser (0.1.6) + +PLATFORMS + ruby + +DEPENDENCIES + http! + reel! diff --git a/README.md b/README.md index e69de29..dbcec6c 100644 --- a/README.md +++ b/README.md @@ -0,0 +1 @@ +siege -c 128 -b -r 12 -q "http://0.0.0.0:3000/v3/orgs POST < org.json" diff --git a/my_server.rb b/my_server.rb new file mode 100755 index 0000000..924e278 --- /dev/null +++ b/my_server.rb @@ -0,0 +1,28 @@ +#!/usr/bin/env ruby +# -*- encoding : utf-8 -*- + +$LOAD_PATH.unshift 'lib' + +require 'rubygems' +require 'bundler/setup' + +require 'reel' + +class MyServer < Reel::Server::HTTP + def initialize host = '127.0.0.1', port = 3000 + super host, port, &method(:on_connection) + end + + def on_connection connection + connection.each_request do |request| + handle_request request + end + end + + def handle_request request + request.respond :ok, 'Hello, world!' + end + +end + +MyServer.run diff --git a/org.json b/org.json new file mode 100644 index 0000000..2d1731a --- /dev/null +++ b/org.json @@ -0,0 +1,7 @@ +{ + "description": "Subledger, Inc.", + "reference": "http://subledger.com", + "annotations": { + "good?": true + } +}