Skip to content

Opening a Websocket

bapquad edited this page Feb 20, 2022 · 2 revisions

[Home] > Opening a Websocket

This content we learn how to open a websocker server and manipulate with socket in Element5JS API.

Create new Websocket connect.

You can create new websocket object by using code like as following example.

let wsc = request5.OpenSocket("ws://localhost:9898/");

Send the text

You can send to server some texts when connected to websocket server completely.

wsc.onOpen((e)=>
{
  wsc.send("Hi! I'm client.");
});