An HTTP Server

Class Methods

Creates a new HTTP server according to config

An HTTP server uses the following attributes:

:AccessLog

An array of access logs. See WEBrick::AccessLog

:BindAddress

Local address for the server to bind to

:DocumentRoot

Root path to serve files from

:DocumentRootOptions

Options for the default HTTPServlet::FileHandler

:HTTPVersion

The HTTP version of this server

:Port

Port to listen on

:RequestCallback

Called with a request and response before each request is serviced.

:RequestTimeout

Maximum time to wait between requests

:ServerAlias

Array of alternate names for this server for virtual hosting

:ServerName

Name for this server for virtual hosting

Instance Methods

Logs req and res in the access logs. config is used for the server name.

The default OPTIONS request handler says GET, HEAD, POST and OPTIONS requests are allowed.

Finds the appropriate virtual host to handle req

Mounts servlet on dir passing options to the servlet at creation time

Mounts proc or block on dir and calls it with a WEBrick::HTTPRequest and WEBrick::HTTPResponse

Processes requests on sock

Finds a servlet for path

Services req and fills in res

An alias for unmount

Unmounts dir

Adds server as a virtual host.