InAppLocalhostServer constructor
InAppLocalhostServer({})
-
port
represents the port of the server. The default value is8080
. -
directoryIndex
represents the index file to use. The default value isindex.html
. -
documentRoot
represents the document root path to serve. The default value is./
. -
The optional argument
shared
specifies whether additionalHttpServer
objects can bind to the same combination ofaddress
,port
andv6Only
. Ifshared
istrue
and moreHttpServer
s from this isolate or other isolates are bound to the port, then the incoming connections will be distributed among all the boundHttpServer
s. Connections can be distributed over multiple isolates this way.
Implementation
InAppLocalhostServer({
int port = 8080,
String directoryIndex = 'index.html',
String documentRoot = './',
bool shared = false,
}) {
this._port = port;
this._directoryIndex = directoryIndex;
this._documentRoot =
(documentRoot.endsWith('/')) ? documentRoot : '$documentRoot/';
this._shared = shared;
}