A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nhooyr/websocket/issues/217 below:

Add example demonstrating a basic WebSocket protocol with message types · Issue #217 · coder/websocket · GitHub

In HTML5 websockt or socket.io, you can consume messages just with the following lines of code:

var io = require('socket.io-client');
var socket = io('http://localhost:6001');

socket.on('connect', function () {
	console.log('connected');
});

socket.on('StockTicker', function (data) {
	console.log(data);
});

socket.on('StockBidAsk', function (data) {
	console.log(data);
});

socket.on('Stock', function (data) {
	console.log(data);
});

How to achieve the example above in this library?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4