WebSocketServer class

A simple WebSocket server.

Call serve to start the server at uri. You can interact with the client through channels.

Caveat: You will need to close each channel manually.

Implemented by

Constructors

WebSocketServer(Uri uri)
WebSocketServer.fromParsed(ArgResults results)
Set up a WebSocketServer with arguments parsed by liveReloadArgParser.
factory

Properties

channels → Stream<WebSocketChannel>
A stream which will emit a WebSocketChannel everytime a new client connects to the server. [...]
read-only
uri → Uri
final
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

forceClose() → Future
Forces the server to close.
serve(String logMessage(HttpServer server)) → Future<Null>
Starts this server at uri and will log a message returned from logMessage when this server is successfully started. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(other) → bool
The equality operator. [...]
inherited

Constants

defaultPort → const dynamic
4242