SkyNeb / Oasis Financial Network RealTime Price Feeder Connector
See also: EngineIoClientDotNet
Install-Package SocketIoClientDotNet
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quobject.SocketIoClientDotNet.Client;
namespace SkyNeb_Socket.io
{
class Program
{
static void Main(string[] args)
{
var socket = IO.Socket("wss://serviceaddress:portnumber");
socket.On(Socket.EVENT_CONNECT, () =>
{
Console.WriteLine("connected...");
});
socket.On("channelname", (data) =>
{
Console.WriteLine(data);
});
Console.ReadLine();
}
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.1.1/socket.io.js"></script>
<script>
var socket = io.connect('wss://serviceaddress:portnumber');
socket.on("channelname",function (data){
console.log(data);
});
</script>
const
io = require("socket.io-client"),
ioClient = io.connect("wss://serviceaddress:portnumber", {transports:['websocket'], rejectUnauthorized:false});
ioClient.on("channelname", (msg) => console.info(msg));
for use "socket.io-client" in server side you have to install "socket.io-client" with npm.
npm install socket.io-client --save