src code

constructor new Client

new Client(url[, options])
  • url (String) – The WebSocket URL to the server to connect to. This should use the ws protocol, port 80 by default. Ex: ws://mygame.com:8080
  • options (Object) – The optional options object's properties are copied to the Client instance. Allows all the same values as found in Client.DEFAULTS.

Instantiates a new Client, using the options found in the options parameter to configure. Clients do not make a socket connection during construction (unlike the WebSocket API in HTML 5). To connect to the server, the Client#connect method must be called first.