Package

fm.http

server

Permalink

package server

Linear Supertypes
PackageImplicits, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. server
  2. PackageImplicits
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class AndThenRequestFilter(a: RequestFilter, b: RequestFilter) extends RequestFilter with Product with Serializable

    Permalink
  2. final case class AsyncResponse(status: Status, headers: Headers, head: Future[Option[LinkedHttpContent]]) extends Response with AsyncMessage with Product with Serializable

    Permalink

    This represents a chunked HTTP Response with headers and the first chunk along with a pointer to the next chunk

  3. trait Auth extends RequestFilter

    Permalink
  4. trait BasicAuth extends Auth with Logging

    Permalink

    Mostly used the Wikipedia page as references: http://en.wikipedia.org/wiki/Basic_access_authentication

  5. final case class ControlHandler(server: HttpServer, authKey: String) extends DefaultRequestRouter with Logging with Product with Serializable

    Permalink
  6. abstract class DefaultRequestRouter extends RequestRouterBase with RequestRouterAndHandler

    Permalink

    This provides a base for both a RequestRouter and RequestHandler that is implemented by using a PartialFunction.

    This provides a base for both a RequestRouter and RequestHandler that is implemented by using a PartialFunction.

    Note: If you need a PartialFunction that takes an Execution context then see the DefaultRequestRouterWithExecutionContext version of this.

  7. abstract class DefaultRequestRouterWithExecutionContext extends RequestRouterBase with RequestRouterAndHandler

    Permalink

    This provides a base for both a RequestRouter and RequestHandler that is implemented by using a PartialFunction.

    This provides a base for both a RequestRouter and RequestHandler that is implemented by using a PartialFunction.

    Note: If you do not need a PartialFunction that takes an Execution context then see the DefaultRequestRouter version of this.

  8. final case class DigestAuth(realm: String, users: Map[String, String], noncePrefix: String, base64EncryptionKey: String, expirationSeconds: Int = 300) extends Auth with Logging with Product with Serializable

    Permalink

    Implements DIGEST HTTP Authentication

    Implements DIGEST HTTP Authentication

    Mostly used the Wikipedia pages as references: http://en.wikipedia.org/wiki/Digest_access_authentication

    NOTE: Use at your own risk. We make no claim that any of this Crypto code is correct.

  9. final case class DomainRedirectFilter(host: String) extends RequestFilter with Product with Serializable

    Permalink

    If the request host doesn't match the host param then redirect

  10. final case class ErrorHandlerRequestRouter(router: RequestRouter, errorHandler: ErrorRequestHandler) extends RequestRouter with Logging with Product with Serializable

    Permalink
  11. trait ErrorRequestHandler extends AnyRef

    Permalink
  12. final case class FileResponse(status: Status, headers: Headers, file: File) extends Response with FileMessage with Product with Serializable

    Permalink

    This represents a File that we want to send back to the user

  13. final case class FilteredRequestHandler(handler: RequestHandler, filter: RequestFilter) extends RequestHandler with Product with Serializable

    Permalink
  14. final case class FilteredRequestRouter(router: RequestRouter, filter: RequestFilter) extends RequestRouter with Product with Serializable

    Permalink
  15. final class FilteredRequestRouterAndHandler extends RequestRouterAndHandler

    Permalink
  16. final case class FullResponse(status: Status, headers: Headers = Headers.empty, buf: ByteBuf = Unpooled.EMPTY_BUFFER) extends Response with FullMessage with Product with Serializable

    Permalink

    This represents a full HTTP Response (both headers and complete body)

  17. final case class HttpContentChunkedInput(input: ChunkedInput[ByteBuf]) extends ChunkedInput[HttpContent] with Product with Serializable

    Permalink

    Takes a ChunkedInput[ByteBuf] and turns it into a ChunkedInput[HttpContent] so the NettyContentCompressor works

  18. final case class HttpServer(port: Int = 8080, router: RequestRouter, authKey: String, serverOptions: HttpServerOptions = HttpServerOptions.default) extends Logging with Product with Serializable

    Permalink
  19. abstract class HttpServerApp extends Logging

    Permalink
  20. final case class HttpServerOptions(requestIdResponseHeader: Option[String], maxRequestsPerConnection: Long = Long.MaxValue, clientIPLookupSpecs: Seq[ClientIPLookupSpec] = ..., maxInitialLineLength: Int = ..., maxHeaderSize: Int = ..., maxChunkSize: Int = ..., requestHandlerExecutionContextProvider: Option[RequestHandlerExecutionContextProvider] = None) extends Product with Serializable

    Permalink

    requestIdResponseHeader

    Set this to include the Request.id in the response headers

    maxRequestsPerConnection

    The maximum number of requests that we will process per connection

    clientIPLookupSpecs

    How to lookup the client IP from headers (in priority order)

    maxInitialLineLength

    HttpRequestDecoder maxInitialLineLength (defaults to 4096)

    maxHeaderSize

    HttpRequestDecoder maxHeaderSize (defaults to 8192)

    maxChunkSize

    HttpRequestDecoder maxChunkSize (defaults to 8192)

    requestHandlerExecutionContextProvider

    An optional RequestExecutionContextProvider instance to control which ExecutionContext gets passed into the RequestHandler. Defaults to using the worker EventLoopGroup.

  21. final case class InputStreamResponse(status: Status, headers: Headers, input: InputStream, length: Option[Long]) extends Response with InputStreamMessage with Product with Serializable

    Permalink

    This represents an InputStream that we want to send back to the user

  22. final case class MultiRequestRouter(routers: Seq[RequestRouter]) extends RequestRouter with Product with Serializable

    Permalink
  23. final class NettyContentCompressor extends HttpContentCompressor

    Permalink

    A Mime-Type aware HttpContentCompressor that won't compress content that shouldn't be compressed

  24. final class NettyHttpServerPipelineHandler extends SimpleChannelInboundHandler[HttpObject] with Logging

    Permalink

    Each connection has one instance of this Handler created which means it can be used to track state if needed.

  25. final case class OrElseRequestRouter(a: RequestRouter, b: RequestRouter) extends RequestRouter with Product with Serializable

    Permalink
  26. final case class RandomAccessFileResponse(status: Status, headers: Headers, file: RandomAccessFile) extends Response with Product with Serializable

    Permalink

    This represents a RandomAccessFile that we want to send back to the user

  27. final class ReloadingClassLoader extends ClassLoader

    Permalink

    WARNING: This CANNOT be a case class because we need the equals method to check for reference equality in case instances of this class are stored in HashMaps (e.g.

    WARNING: This CANNOT be a case class because we need the equals method to check for reference equality in case instances of this class are stored in HashMaps (e.g. in scala.reflect.runtime.JavaMirrors). Otherwise 2 ReloadingClassLoader with the same argument will look equal to each other even though they have loaded different versions of classes. This will cause stuff like:

    java.lang.ClassCastException: fm.catalog.website.CatalogSite cannot be cast to fm.catalog.website.CatalogSite

  28. final class ReloadingClassLoaderHolder extends ClassLoader with Logging

    Permalink

    Holds a reference to a ReloadingClassLoader

    Holds a reference to a ReloadingClassLoader

    I forget why this originally extended URLClassLoader. I think it might be because some code out there expects the ClassLoader to be a URLClassLoader.

    WARNING: See the warning in ReloadingClassLoader about why this is NOT a case class

  29. final case class ReloadingRequestRouter(className: String, reloadablePackages: Seq[String], parent: ClassLoader = ..., debug: Boolean = false) extends RequestRouter with Logging with Product with Serializable

    Permalink

    A RequestRouter that wraps another RequestRouter which will reload classes that change on the fly.

    A RequestRouter that wraps another RequestRouter which will reload classes that change on the fly.

    For best results limit the scope of the reloadablePackages.

  30. final class Request extends Logging with Closeable

    Permalink
  31. trait RequestFilter extends AnyRef

    Permalink
  32. trait RequestHandler extends WithFilter[RequestHandler]

    Permalink
  33. trait RequestHandlerExecutionContextProvider extends AnyRef

    Permalink

    This allows you to provide a custom ExecutionContext based on the Request that gets passed into the RequestHandler.handle method when the HTTP Server is serving a request.

    This allows you to provide a custom ExecutionContext based on the Request that gets passed into the RequestHandler.handle method when the HTTP Server is serving a request. This allows you to do things like provide a PriorityQueue based ThreadPoolExecutor that can use the timestamp from the Request as the priority to ensure that requests are processed in a FIFO (the first request in has the highest priority) ordering to prevent Requests with lots of remote calls or Future callbacks from being starved of CPU time.

  34. class RequestLocal[T] extends AnyRef

    Permalink

    Like a ThreadLocal except for Requests

    Like a ThreadLocal except for Requests

    You can either instantiate this directly or extend it:

    val username = new RequestLocal[String]
    object username extends RequestLocal[String]
  35. trait RequestRouter extends WithFilter[RequestRouter]

    Permalink
  36. trait RequestRouterAndHandler extends RequestRouter with RequestHandler with WithFilter[RequestRouterAndHandler]

    Permalink
  37. abstract class RequestRouterBase extends RequestRouter

    Permalink

    Adds wrappers around the lifecycle calls to ensure they only get called once

  38. abstract class RequestRouterProxy extends RequestRouterBase

    Permalink

    Proxies to another RequestRouter

  39. sealed trait Response extends Message

    Permalink
  40. final case class SingleHandlerRequestRouter(handler: RequestHandler) extends RequestRouter with Product with Serializable

    Permalink

    A RequestRouter that always returns the same handler which should be useful for 404 pages

  41. final case class StaticClasspathFileHandler(roots: Seq[File], devMode: Boolean, classLoader: ClassLoader) extends StaticFileHandlerBase with Logging with Product with Serializable

    Permalink
  42. final case class StaticFileHandler(roots: Seq[File], devMode: Boolean) extends StaticFileHandlerBase with Product with Serializable

    Permalink
  43. trait StaticFileHandlerBase extends RequestRouter

    Permalink
  44. final case class VirtualHostRequestRouter(map: Map[String, RequestRouter]) extends RequestRouter with Product with Serializable

    Permalink

    A RequestRouter that will dispatch to another RequestRouter based on the virtual host name.

    A RequestRouter that will dispatch to another RequestRouter based on the virtual host name.

    Note: The most specific match wins

    Map( "frugalmechanic.com" -> ??? // Matches just "frugalmechanic.com" "*.frugalmechanic.com" -> ??? // Matches any.level.of.sub.domain.frugalmechanic.com (unless there are other more explicit entries) "*" -> ??? // Default catch all )

  45. trait WithFilter[+A <: WithFilter[A]] extends AnyRef

    Permalink

Value Members

  1. object BasicAuth

    Permalink
  2. object ControlHandler extends Serializable

    Permalink
  3. object DigestAuth extends Serializable

    Permalink
  4. object EmptyRequestRouter extends RequestRouter with Product with Serializable

    Permalink
  5. object ErrorRequestHandler

    Permalink
  6. object HttpServer extends Serializable

    Permalink
  7. object HttpServerOptions extends Serializable

    Permalink
  8. object NettyContentCompressor

    Permalink
  9. object NettyHttpServerPipelineHandler

    Permalink
  10. object ReloadingClassLoaderHolder

    Permalink
  11. object Request

    Permalink
  12. object RequestFilter

    Permalink
  13. object RequestHandler

    Permalink
  14. object RequestHandlerExecutionContextProvider

    Permalink
  15. object RequestLocal

    Permalink
  16. object RequestRouter

    Permalink
  17. object RequireSSLFilter extends RequestFilter

    Permalink

    If the X-SSL header is not set then this redirects to the HTTPS version of the requested URL.

    If the X-SSL header is not set then this redirects to the HTTPS version of the requested URL.

    TODO: probably need to do something smarter with POST/PUT/etc requests.

  18. object Response

    Permalink
  19. object RouteMatchers

    Permalink
  20. object StaticClasspathFileHandler extends Serializable

    Permalink
  21. object StaticFileHandler extends Serializable

    Permalink
  22. implicit def toNettyFutureWrapper[T](f: Future[T]): NettyFutureWrapper[T]

    Permalink
    Definition Classes
    PackageImplicits
  23. implicit def toNettyPromiseWrapper[T](p: Promise[T]): NettyPromiseWrapper[T]

    Permalink
    Definition Classes
    PackageImplicits

Inherited from PackageImplicits

Inherited from AnyRef

Inherited from Any

Ungrouped