class Earl::HTTPServer
- Earl::HTTPServer
- Earl::SockServer
- Earl::Supervisor
- Reference
- Object
Overview
A HTTP/1 server.
- Based on
SockServer
, thus binds and listens on many interfaces and ports (TCP, SSL, UNIX); - Leverages
HTTP::Server
request processor and supports all existingHTTP::Handler
.
Defined in:
http_server.crConstructors
- .new(handlers = [] of HTTP::Handler, &block : HTTP::Server::Context -> )
- .new(handlers : Array(HTTP::Handler))
Instance Method Summary
-
#call(socket : Earl::Socket)
Processes the incoming HTTP connection.
-
#reset
Recycles all supervised agents.
-
#terminate
Asks all supervised agents to stop.
Instance methods inherited from class Earl::SockServer
add_listener(uri : String) : Niladd_listener(uri : URI) : Nil add_listener, add_ssl_listener(host : String, port : Int32, ssl_context : OpenSSL::SSL::Context::Server, *, backlog = ::Socket::SOMAXCONN) : Nil add_ssl_listener, add_tcp_listener(host : String, port : Int32, *, backlog = ::Socket::SOMAXCONN) : Nil add_tcp_listener, add_unix_listener(path : String, *, mode = nil, backlog = ::Socket::SOMAXCONN) : Nil add_unix_listener, call(client : Socket) call, started? : Bool started?
Instance methods inherited from class Earl::Supervisor
call
call,
monitor(agent : Agent) : Nil
monitor,
reset : Nil
reset,
terminate : Nil
terminate,
trap(agent : Agent, exception : Exception | Nil) : Nil
trap
Constructor methods inherited from class Earl::Supervisor
new
new
Instance methods inherited from module Earl::Logger
log
log
Class methods inherited from module Earl::Logger
backends : Array(Backend)
backends,
debug(agent : Agent, message : String) : Nildebug(agent : Agent, &block : -> String) : Nil debug, debug? : Bool debug?, error(agent : Agent, message : String) : Nil
error(agent : Agent, &block : -> String) : Nil
error(agent : Agent, ex : Exception) error, error? : Bool error?, info(agent : Agent, message : String) : Nil
info(agent : Agent, &block : -> String) : Nil info, info? : Bool info?, level : Severity level, level=(severity : Severity) : Severity level=, silent? : Bool silent?, warn(agent : Agent, message : String) : Nil
warn(agent : Agent, &block : -> String) : Nil warn, warn? : Bool warn?