module Net::HTTP::Server
Constants
- VERSION
net-http-server version.
Public Class Methods
run(options={},&block)
click to toggle source
@param [Hash] options
Options for the server.
@option options [String] :host (DEFAULT_HOST)
The host to run on.
@option options [String] :port (DEFAULT_PORT)
The port to listen on.
@option options [Integer] :max_connections (MAX_CONNECTIONS)
The maximum number of simultaneous connections.
@option options [Boolean] :background (false)
Specifies whether to run the server in the background or foreground.
@option options [#call] :handler
The HTTP Request Handler object.
@yield [request, socket]
If a block is given, it will be used to process HTTP Requests.
@yieldparam [Hash{Symbol => String,Array,Hash}] request
The HTTP Request.
@yieldparam [TCPSocket] socket
The TCP socket of the client.
# File lib/net/http/server/server.rb, line 39 def Server.run(options={},&block) daemon = Daemon.new(options,&block) daemon.start daemon.join unless options[:background] return daemon end