This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First go to http://docs.bitfinex.com and click on the websockets tab | |
// Scroll down and find the SSL websocket connection URL | |
For example: wss://api.bitfinex.com/ws | |
// In a new Javascript file create a variable for new websocket | |
var ws = new WebSocket('wss://api.bitfinex.com/ws'); | |
// Create function to send on open | |
ws.onopen = function() { | |
ws.send(JSON.stringify({"event":"subscribe", "channel":"ticker", "pair":"BTCUSD"})); |