overwolf.web.websocket

An instance of websocket.

Note that it is best to use the native js WebSockets when u can. Our web sockets by-pass cert checks for localhost WSS servers like LCU (league of legends).

Methods

connect(callback)

Version added: 0.129

Listens for requests on the given port. If the port is already in use, or this instance is already listening, an error will be returned.

  • Parameter: callback <function>

    Fired with the status of the connection.

send(message, callback)

Version added: 0.129

send message.

  • Parameter: message <string>

    Message to send.

  • Parameter: callback <function>

    Called with the status of the request.

close()

Version added: 0.129

Closes the websocket. It can be re-opened again.

Events How to use events

onMessage

Version added: 0.129

Fired when the websocket receives an incoming message.

onError

Version added: 0.129

Fired on error.

onOpen

Version added: 0.129

Fired on websocket connection Opened.

onClosed

Version added: 0.129

Fired when connection closed.