Class: WS

WS

Provides methods and properties to interact with the web server.


Methods


createSite(directory, name)

Parameters:
Name Type Description
directory string

The name of the temporary directory which the web server will use to serve files.

name string

The optional name to assign to the WSSite object. It can later be accessed from WS using this name.

Since:
  • 0.1 (WAT 2.0)
Returns:
Type
ws.WSSite

createSocket( [port] [, name])

Parameters:
Name Type Argument Default Description
port int <optional>
0

The TCP port number on which to create the web socket.

name string <optional>
""

The optional name to assign to the WSSocket object. It can later be accessed from WS using this name.

Since:
  • 0.1 (WAT 2.0)
Returns:
Type
ws.WSSocket

createSocketPath( [path] [, name])

Parameters:
Name Type Argument Default Description
path string <optional>
""

The path on the webserver to create the web socket on.

name string <optional>
""

The optional name to assign to the WSSocket object. It can later be accessed from WS using this name.

Since:
  • 1.1 (WAT 2.3)
Returns:
Type
ws.WSSocket

deleteSite(site)

Parameters:
Name Type Description
site ws.WSSite

The WSSite object to delete.

Since:
  • 0.1 (WAT 2.0)

deleteSocket(socket)

Parameters:
Name Type Description
socket ws.WSSocket

The WSSocket object to delete.

Since:
  • 0.1 (WAT 2.0)