LocalServerService class

Http Server 服务 @author jm

Inheritance

Constructors

LocalServerService()
factory

Properties

curAddresses String?
getter/setter pairinherited
curPort int
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isOpenServer bool
getter/setter pairinherited
observe LocalServerStatusHandler?
getter/setter pairinherited
referenceCounter int
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverSub StreamSubscription?
getter/setter pairinherited

Methods

cancelServer() → void
关闭http server服务
cancelStatusObserver() → void
关闭状态回调
closeServer({bool force = false}) → void
关闭http server服务, 并且取消状态回调 force 为true,立即关闭 见HttpServer.close
getLocalServerWebUrl(String oriUrl, String localServerKey) String
获取对应 oriUrl 的 Local Server url(如http://127.0.0.1:12345) localServerKey 是拼接的path和query,如 test/index.html?v=1 返回的完整url为:http://127.0.0.1:12345/test/index.html?v=1
invoke() → dynamic
初始化配置 目录的加载
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerStatusObserve(LocalServerStatusHandler handler) → void
注册状态回调 详见LocalServerStatusHandler
startServer([String? address, int? port]) Future<HttpServer>
开启http server服务 见HttpServer.bind address若为null,则默认是127.0.0.1 port 若为null,则默认是0
toString() String
A string representation of this object.
inherited

Operators

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