DoxServer class

Constructors

DoxServer()
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
httpServer ↔ HttpServer
the http server. a NativeHttpServer (dox_http_native) or the dart:io one. both have the same HttpServer API.
getter/setter pair
responseHandler ↔ ResponseHandlerInterface?
set responseHandler
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close({bool force = false}) → Future<void>
close http server
listen(int port, {Object? address, Function? onError, int? isolateId}) → Future<HttpServer>
listen the request. With no address it listens on all interfaces.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setResponseHandler(ResponseHandlerInterface? handler) → void
set response handler
shutdown(Duration timeout) → Future<void>
Graceful stop: no new connections, open requests get timeout to finish. Then every connection is closed.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

hostFor(String? configured) → String?
The host to listen on: configured, else APP_HOST, else null (all interfaces).
portFor(int configured) → int
The port to listen on. APP_PORT in the env means configured (the app reads it into serverPort). With no APP_PORT, PORT wins: Cloud Run, Fly, Render and Heroku tell the app its port with it.
usesNative({bool log = false}) → bool
true when listen will use the native server (dox_http_native). log prints why it does not, once.