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: 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 RequestHandler

    Permalink
  7. 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.

  8. 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

  9. final case class ErrorHandlerRequestRouter(router: RequestRouter, errorHandler: ErrorRequestHandler)(implicit ec: ExecutionContext) extends RequestRouter with Logging with Product with Serializable

    Permalink
  10. type ErrorRequestHandler = (Request, Throwable) ⇒ Future[Response]

    Permalink
  11. 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

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

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

    Permalink
  14. 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)

  15. 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

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

    Permalink
  17. abstract class HttpServerApp extends Logging

    Permalink
  18. final case class HttpServerOptions(requestIdResponseHeader: Option[String], maxRequestsPerConnection: Long = Long.MaxValue, clientIPLookupSpecs: Seq[ClientIPLookupSpec] = ...) 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)

  19. 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

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

    Permalink
  21. final class NettyContentCompressor extends HttpContentCompressor

    Permalink

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

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

    Permalink

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

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

    Permalink
  24. 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

  25. 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

  26. 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

  27. 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.

  28. final class Request extends Logging with Closeable

    Permalink
  29. trait RequestFilter extends AnyRef

    Permalink
  30. type RequestHandler = (Request) ⇒ Future[Response]

    Permalink
  31. 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]
  32. trait RequestRouter extends AnyRef

    Permalink
  33. abstract class RequestRouterBase extends RequestRouter

    Permalink

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

  34. abstract class RequestRouterProxy extends RequestRouterBase

    Permalink

    Proxies to another RequestRouter

  35. sealed trait Response extends Message

    Permalink
  36. implicit final class RichRequestHandler extends AnyVal

    Permalink
  37. 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

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

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

    Permalink
  40. trait StaticFileHandlerBase extends RequestRouter

    Permalink
  41. 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 )

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 HttpServer extends Serializable

    Permalink
  6. object HttpServerOptions extends Serializable

    Permalink
  7. object NettyContentCompressor

    Permalink
  8. object NettyHttpServerPipelineHandler

    Permalink
  9. object ReloadingClassLoaderHolder

    Permalink
  10. object Request

    Permalink
  11. object RequestFilter

    Permalink
  12. object RequestHandler

    Permalink
  13. object RequestLocal

    Permalink
  14. object RequestRouter

    Permalink
  15. 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.

  16. object Response

    Permalink
  17. object RouteMatchers

    Permalink
  18. object StaticClasspathFileHandler extends Serializable

    Permalink
  19. object StaticFileHandler extends Serializable

    Permalink
  20. implicit def requestHandlerToErrorRequestHandler(handler: RequestHandler): ErrorRequestHandler

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

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

    Permalink
    Definition Classes
    PackageImplicits

Inherited from PackageImplicits

Inherited from AnyRef

Inherited from Any

Ungrouped