JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-3.0.0-rc1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.6/socket.io.min.js"></script>
<div style="">
<h3>Подписка на стакан сделок</h3>
</div>
<hr/>
<div id="results"></div>
JavaScript
$results = $('#results');
function addLog(data) {
var currentdate = new Date();
$results.html( $results.html() + currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":"
+ currentdate.getSeconds() + " - " + JSON.stringify(data) + '<hr/>' );
}
var WS_SOCKETURL = 'https://ws2.tradernet.ru/';
var ws = io(WS_SOCKETURL);
var tickersToWatchChanges = ["UXH7", "UXM7", "UXG7", "DXH7", "DXM7", "DXG7", "DEH7", "DEM7", "DEG7", "GXH7", "GXM7", "GXG7", "UUH7", "UUM7", "UUG7", "KUBI", "ALMK", "AVDK", "AZST", "BAVL", "CEEN", "DOEN", "ENMZ", "MSICH", "UNAF", "USCB"];
var ticker = 'TRNFP';
ws.on('b', function (data) {
addLog(data);
});
ws.on('connect', function () {
addLog('CONNECTED TO WS!');
ws.emit("sup_updateDom", tickersToWatchChanges);
});