Sha256: 7488b1bd48e7db66ff7f5c6bc7e2391c7ca8b4ccda315b70d2e07da77541a835

Contents?: true

Size: 862 Bytes

Versions: 9

Compression:

Stored size: 862 Bytes

Contents

#!/usr/bin/env ruby
# Run with: bundle exec examples/hello_world.rb

require 'rubygems'
require 'bundler/setup'
require 'reel'

addr, port = '127.0.0.1', 4430
options = {
  :cert => File.read(File.expand_path("../../spec/fixtures/server.crt", __FILE__)),
  :key  => File.read(File.expand_path("../../spec/fixtures/server.key", __FILE__))
}

puts "*** Starting server on #{addr}:#{port}"
Reel::Server::HTTPS.supervise(addr, port, options) do |connection|
  # For keep-alive support
  connection.each_request do |request|
    # Ordinarily we'd route the request here, e.g.
    # route request.url
    request.respond :ok, "hello, world!"
  end

  # Reel takes care of closing the connection for you
  # If you would like to hand the connection off to another thread or actor,
  # use, connection.detach and then manually call connection.close when done
end

sleep

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
reel-0.6.1 examples/https_hello_world.rb
reel-0.6.0 examples/https_hello_world.rb
reel-0.6.0.pre5 examples/https_hello_world.rb
reel-0.6.0.pre4 examples/https_hello_world.rb
reel-0.6.0.pre3 examples/https_hello_world.rb
reel-0.6.0.pre2 examples/https_hello_world.rb
reel-0.6.0.pre1 examples/https_hello_world.rb
reel-0.5.0 examples/https_hello_world.rb
reel-0.5.0.pre examples/https_hello_world.rb