Sha256: c7422ce58c074f423746aeabafe66c8bfab227ffdfe65100610bf43a8d1d4345

Contents?: true

Size: 589 Bytes

Versions: 1

Compression:

Stored size: 589 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!')
  # req.send_headers
  # req.send_body_chunk("Method: #{req.method}\n")
  # req.send_body_chunk("Path: #{req.path}\n")
  # req.send_body_chunk("Query: #{req.query.inspect}\n", done: true)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyphony-0.19 examples/http/https_server.rb