finagle-clojure.http.server

close!

(close! server)

Stops the given Server.

Arguments:

  • server: an Http.Server

Returns:

a Future that closes when the server stops

configured

(configured server p)

Configures the given Http.Server with the desired Stack.Param. Generally, prefer one of the explicit configuration functions over this.

Arguments:

  • server: an Http.Server
  • p: a parameter that will be subsequently wrapped with Stack.Param

Returns:

the given Http.Server

http-server

(http-server)

The base HTTP server. Call serve on this once configured to begin listening to requests.

Arguments:

  • None.

Returns:

an instance of Http.Server

serve

(serve address service)(serve server address service)

Creates a new HTTP server listening on the given address and responding with the given service or service factory. The service must accept requests of type HttpRequest, and respond with a Future wrapping an HttpResponse.

Arguments:

  • address: a listening address, either a string of the form ":port" or a SocketAddress
  • service: a responding service, either a Service or a ServiceFactory
  • server (optional): a preconfigured Http.Server

Returns:

a running ListeningServer

with-max-request-size

(with-max-request-size server size)

Configures the given Http.Server with a max request size.

Arguments:

  • server: an Http.Server
  • size: a StorageUnit of the desired request size

Returns:

the given Http.Server

with-max-response-size

(with-max-response-size server size)

Configures the given Http.Server with a max response size.

Arguments:

  • server: an Http.Server
  • size: a StorageUnit of the desired response size

Returns:

the given Http.Server

with-tls

(with-tls server cfg)

Configures the given Http.Server with TLS.

Arguments:

  • server: an Http.Server
  • cfg: a Netty3ListenerTLSConfig config

Returns:

the given Http.Server