js web socket code example with particle realization