Class: H2::Server::HTTP
- Inherits:
-
H2::Server
- Object
- H2::Server
- H2::Server::HTTP
- Defined in:
- lib/h2/server.rb
Overview
‘h2c’ server - for plaintext HTTP/2 connection
NOTE: browsers don’t support this and probably never will
Constant Summary
Constants inherited from H2::Server
Instance Method Summary collapse
-
#initialize(host:, port:, **options, &on_connection) ⇒ HTTP
constructor
create a new h2c server.
- #run ⇒ Object
Methods inherited from H2::Server
#goaway, #handle_connection, #handle_push_promise, #handle_stream, #shutdown
Constructor Details
#initialize(host:, port:, **options, &on_connection) ⇒ HTTP
create a new h2c server
85 86 87 88 89 |
# File 'lib/h2/server.rb', line 85 def initialize host:, port:, **, &on_connection @tcpserver = Celluloid::IO::TCPServer.new host, port .merge! host: host, port: port super @tcpserver, , &on_connection end |
Instance Method Details
#run ⇒ Object
91 92 93 |
# File 'lib/h2/server.rb', line 91 def run loop { async.handle_connection @server.accept } end |