WebSocket
public class WebSocket
Main class for the Kitura-WebSocket API. Used to register WebSocketService
classes
that will handle WebSocket connections for specific paths.
-
Register a
WebSocketService
for a specific pathDeclaration
Swift
public static func register(service: WebSocketService, onPath path: String)
Parameters
service
The
WebSocketService
being registered.onPath
The path that will be in the HTTP “Upgrade” request. Used to connect the upgrade request with a specific
WebSocketService
Caps-insensitive. -
Unregister a
WebSocketService
for a specific pathDeclaration
Swift
public static func unregister(path: String)
Parameters
path
The path on which the
WebSocketService
being unregistered, was registered on.