const class wisp::WispService
sys::Obj wisp::WispService : sys::Service
Simple web server services HTTP/HTTPS requests to a top-level root WebMod. A given instance of WispService can be only be used through one start/stop lifecycle.
Example:
WispService { httpPort = 8080; root = MyWebMod() }.start
- addr
-
const IpAddr? addr := nullWhich IpAddr to bind to or null for the default.
- errMod
-
const WebMod errMod := initErrModWebMod which is called on internal server error to return an 500 error response. The exception raised is available in
req.stash["err"]. TheonServicemethod is called after clearing all headers and setting the response code to 500. The default error mod may be configured viaerrModproperty in etc/web/config.props. - extraResHeaders
-
const Str:Str extraResHeaders := initExtraResHeadersMap of HTTP headers to include in every response. These are initialized from etc/web/config.props with the key "extraResHeaders" as a set of "key:value" pairs separated by semicolons.
- httpPort
-
const Int? httpPort := nullWell known TCP port for HTTP traffic. The port is enabled if non-null and disabled if null.
- httpsPort
-
const Int? httpsPort := nullWell known TCP port for HTTPS traffic. The port is enabled if non-null and disabled if null. If the http and https ports are both non-null then all http traffic will be redirected to the https port.
- make
-
new make(|This|? f := null)Constructor with it-block
- maxThreads
-
const Int maxThreads := 500Max number of threads which are used for concurrent web request processing.
- onStart
-
virtual override Void onStart() - onStop
-
virtual override Void onStop() - root
-
const WebMod root := WispDefaultRootMod.<ctor>()Root WebMod used to service requests.
- sessionCookieName
-
const Str sessionCookieName := ...Cookie name to use for built-in session management. Initialized from etc/web/config.props with the key "sessionCookieName" otherwise defaults to "fanws"
- sessionStore
-
const WispSessionStore sessionStore := MemWispSessionStore.<ctor>(this)Pluggable interface for managing web session state. Default implementation stores sessions in main memory.
- socketConfig
-
const SocketConfig socketConfig := SocketConfig.curThe
SocketConfigto use for creating sockets