NanoServer

automorph.transport.http.server.NanoServer
See theNanoServer companion object

NanoHTTPD HTTP & WebSocket server message transport plugin.

Interprets HTTP request body as an RPC request and processes it using the specified RPC request handler.

  • The response returned by the RPC request handler is used as HTTP response body.
  • Processes only HTTP requests starting with specified URL path.

Type parameters

Effect

effect type

Value parameters

effectSystem

effect system plugin

mapException

maps an exception to a corresponding HTTP status code

methods

allowed HTTP request methods

pathPrefix

HTTP URL path prefix, only requests starting with this path prefix are allowed

port

port to listen on for HTTP connections

readTimeout

request read timeout

threads

number of request processing threads

webSocket

support upgrading of HTTP connections to use WebSocket protocol if true, support HTTP only if false

Attributes

Constructor

Creates a NanoHTTPD HTTP & WebSocket server with specified effect system.

See also
Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ServerTransport[Effect, Context]
class NanoWSD
class NanoHTTPD
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

class ClientHandler(x$1: InputStream, x$2: Socket)

Attributes

Inherited from:
NanoHTTPD
Supertypes
trait Runnable
class Object
trait Matchable
class Any
object ClientHandler

Attributes

Inherited from:
NanoHTTPD
Supertypes
class Object
trait Matchable
class Any
class CookieHandler(x$0: Map[String, String])

Attributes

Inherited from:
NanoHTTPD
Supertypes
trait Iterable[String]
class Object
trait Matchable
class Any
object CookieHandler

Attributes

Inherited from:
NanoHTTPD
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
NanoHTTPD
Supertypes
trait Runnable
class Object
trait Matchable
class Any

Attributes

Inherited from:
NanoHTTPD
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

override def close(): Effect[Unit]

Stops this server transport freeing the underlying resources.

Stops this server transport freeing the underlying resources.

Attributes

Returns

nothing

Definition Classes
override def init(): Effect[Unit]

Starts this server to process incoming requests.

Starts this server to process incoming requests.

Attributes

Returns

active RPC server

Definition Classes
override def withHandler(handler: RequestHandler[Effect, Context]): NanoServer[Effect]

Create a copy of this server transport with specified RPC request handler.

Create a copy of this server transport with specified RPC request handler.

Value parameters

handler

RPC request handler

Attributes

Returns

server transport

Definition Classes

Inherited methods

Attributes

Inherited from:
NanoHTTPD
def getHostname(): String

Attributes

Inherited from:
NanoHTTPD
final def getListeningPort(): Int

Attributes

Inherited from:
NanoHTTPD

Attributes

Inherited from:
NanoHTTPD

Attributes

Inherited from:
NanoHTTPD
final def isAlive(): Boolean

Attributes

Inherited from:
NanoHTTPD
def makeSecure(x$0: SSLServerSocketFactory, x$1: Array[String]): Unit

Attributes

Inherited from:
NanoHTTPD

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def serve(x$0: IHTTPSession): BlockingQueue[Response]

Attributes

Inherited from:
NanoWSD

Attributes

Inherited from:
NanoHTTPD

Attributes

Inherited from:
NanoHTTPD

Attributes

Inherited from:
NanoHTTPD
def start(x$0: Int): Unit

Attributes

Inherited from:
NanoHTTPD
def start(): Unit

Attributes

Inherited from:
NanoHTTPD
def stop(): Unit

Attributes

Inherited from:
NanoHTTPD
final def wasStarted(): Boolean

Attributes

Inherited from:
NanoHTTPD

Deprecated and Inherited methods

@Deprecated
def serve(x$0: String, x$1: Method, x$2: Map[String, String], x$3: Map[String, String], x$4: Map[String, String]): Response

Attributes

Deprecated
true
Inherited from:
NanoHTTPD

Inherited fields

protected val logger: Logger

Attributes

Inherited from:
Logging (hidden)