Websocket endpoints should use the domain with sub path: https://api.resfinex.com/ws/
https://api.resfinex.com/ws/
import WebSocket from 'ws'; import url from "url" //Build websocket url const wsUrl = url.format({ protocol:"wss", host: "api.resfinex.com", pathname: "/ws/ws/allTicker", query: {} }) console.log(wsUrl) let ws = new WebSocket(wsUrl) ws.onmessage = event => { let parseData = JSON.parse(event.data) let [dataType,tickers] = parseData //There are many type of data, please check dataType for incoming data if(dataType == "/ws/allTicker"){ console.table(tickers) } }
← Authenticated APIs REST PUBLIC ENDPOINTS →