2016-04-12 16 views
1

Bitfinex's Websocket API bir bağlantı init için nasıl aşağıdaki demo sahiptir:Bitfinex en WebSocket'e API "merhaba dünya" ECONNREFUSED yanlışlıkla sonuçları

//using the ws library 
var WebSocket = require('ws'); 
var w = new WebSocket("wss://api2.bitfinex.com:3000/ws"); 
w.onmessage = function(msg) { 
    console.log(msg.data); 
}; 

o örnek Koşu node.js sürümü v5.9.1 ve ws sürümünde aşağıdaki hatayla 1.0.1 sonuçları ile:

events.js:154 
     throw er; // Unhandled 'error' event 
    ^

Error: connect ECONNREFUSED 178.249.189.15:3000 
    at Object.exports._errnoException (util.js:890:11) 
    at exports._exceptionWithHostPort (util.js:913:20) 
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1061:14) 

Bu hatanın nedeni nedir?

cevap

0

Sunucu bağlantıyı reddediyor ... bağlantı noktası (: 3000) veya Ana makine adı olabilir. Sürüm 2 şu anki için geçerlidir: anpi.bitfinex.com - tam url kullanıyorum: wss: //api.bitfinex.com/ws/2 (7/11/2017) itibarıyla