xviz/docs/api-reference/server/overview-handler.md
Timothy Wojtaszek 6a85f68a72 @xviz/server module (#453)
Proper module to replace our adhoc server script with a structured middleware-based implementation.

Key documents are:
 - RFC ./dev-docs/004-server-module-rfc.md
 - User Docs ./docs/api-reference/server
 - Module Readme ./modules/server/README.md
2019-05-23 16:34:18 -07:00

649 B

XVIZHandler Interface

An XVIZHandler will be called to provide an XVIZSession to handle the request made to the XVIZServer.

Interface

async newSession(socket, request)

Using the socket and request a handler must decide if this connection can be handled.

Parameters:

  • socket (Object) - The socket from the server
  • request (Object) - The request object from the server

Returns: (XVIZSession|null) - A session to handle this connection or null if the request cannot be handled.