Sha256: 29b5ce8d609251807026cfcbe3169cd0ef121f305addf03297dce3ccc2f54fc5

Contents?: true

Size: 584 Bytes

Versions: 9

Compression:

Stored size: 584 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony/http'
require 'localhost/authority'

authority = Localhost::Authority.fetch
opts = {
  reuse_addr:     true,
  dont_linger:    true,
  secure_context: authority.server_context
}

puts "pid: #{Process.pid}"
puts 'Listening on port 1234...'
Polyphony::HTTP::Server.serve('0.0.0.0', 1234, opts) do |req|
  req.respond("Hello world!\n")
  # req.send_headers
  # req.send_chunk("Method: #{req.method}\n")
  # req.send_chunk("Path: #{req.path}\n")
  # req.send_chunk("Query: #{req.query.inspect}\n", done: true)
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
polyphony-http-0.28 examples/https_server.rb
polyphony-http-0.27 examples/https_server.rb
polyphony-http-0.26 examples/https_server.rb
polyphony-http-0.25 examples/https_server.rb
polyphony-http-0.24 examples/https_server.rb
polyphony-0.23 examples/http/https_server.rb
polyphony-0.22 examples/http/https_server.rb
polyphony-0.21 examples/http/https_server.rb
polyphony-0.20 examples/http/https_server.rb