io

new io(serveropt, configopt)

The socket module that allows for peer-to-peer connection support.

Parameters:
NameTypeAttributesDescription
serverObject<optional>

Reference to the HTTP server that will be used to listen for new connections

configObject<optional>

Settings for the socket connection; used for setting CORS origin for connection

Events

connect

The client-side socket object that will connect to the server

Type:
  • Object
Parameters:
NameTypeAttributesDescription
pathstring<optional>

Endpoint to connect to the associated server where io.connect is

Fires:
  • socket#event:emit
Listens to Events:
Listeners of This Event:

on

Handles setting up initial server-side functions for new socket.io connections that it picks up.

Parameters:
NameTypeAttributesDescription
labelstring<optional>

Label of the signal that io picks up

callbackfunction<optional>

Function that acts on a connecting socket that is called when hit

Listens to Events: