This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
"Hello from Sinatra running on Java!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'goliath' | |
require 'digest/sha1' | |
class ShaStream < Goliath::API | |
# use Goliath::Rack::Params | |
def on_headers(env, headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'goliath' | |
require 'digest/sha1' | |
class ShaStream < Goliath::API | |
def on_headers(env, headers) | |
env['async-digest'] = Digest::SHA1.new # SHA1 or MD5 | |
str = env['CONTENT_TYPE'].match(/multipart\/form-data.*boundary\=?([^"\;,]+)?/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread' | |
require 'net/http' | |
require 'base64' | |
require 'openssl' | |
class Producer | |
def initialize | |
@mutex = Mutex.new | |
@body = '' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'goliath' | |
require 'digest/sha1' | |
class ShaStream < Goliath::API | |
def on_headers(env, headers) | |
env['async-digest'] = Digest::SHA1.new # SHA1 or MD5 | |
str = env['CONTENT_TYPE'].match(/multipart\/form-data.*boundary\=?([^"\;,]+)?/) |