Open jzyzxx opened 3 years ago
hi @jzyzxx
How could you deal with proxy with future
feature?
_binance = new BinanceApi().options({
proxy:{
host:"p.webshare.io",
port:"80",
auth: "userName:password"
},
'APIKEY': apiKey,
'APISECRET': apiSecret,
'test': true,
useServerTime: true
});
The error return tunneling socket could not be established, statusCode=407
.
Am I config correctly?
hi @jzyzxx How could you deal with proxy with
future
feature?_binance = new BinanceApi().options({ proxy:{ host:"p.webshare.io", port:"80", auth: "userName:password" }, 'APIKEY': apiKey, 'APISECRET': apiSecret, 'test': true, useServerTime: true });
The error return
tunneling socket could not be established, statusCode=407
. Am I config correctly?
The proxy did not work for ws connectionn,maybe you shoud get tips from the author
I can config successfully in http with username and password.
_binance = new BinanceApi().options({
proxy:{
host:"p.webshare.io",
port:"80",
auth: {
username: "yourUserName",
password: "yourPassword"
},
},
'APIKEY': apiKey,
'APISECRET': apiSecret,
'test': true,
useServerTime: true
});
I can config successfully in http with username and password.
_binance = new BinanceApi().options({ proxy:{ host:"p.webshare.io", port:"80", auth: { username: "yourUserName", password: "yourPassword" }, }, 'APIKEY': apiKey, 'APISECRET': apiSecret, 'test': true, useServerTime: true });
But it dit not work for ws connection,the log indicated that the connection timeout.
I can config successfully in http with username and password.
_binance = new BinanceApi().options({ proxy:{ host:"p.webshare.io", port:"80", auth: { username: "yourUserName", password: "yourPassword" }, }, 'APIKEY': apiKey, 'APISECRET': apiSecret, 'test': true, useServerTime: true });
But it dit not work for ws connection,the log indicated that the connection timeout.
There are my logs:
[ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ]
[ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ]
[
'Futures WebSocket error: btcusdt@miniTicker (ETIMEDOUT) connect ETIMEDOUT 31.13.69.160:443'
]
[ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ]
[ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ]
[
'Futures WebSocket error: btcusdt@miniTicker (ETIMEDOUT) connect ETIMEDOUT 111.243.214.169:443'
]
[ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ]
[ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ]
I can config successfully in http with username and password.
_binance = new BinanceApi().options({ proxy:{ host:"p.webshare.io", port:"80", auth: { username: "yourUserName", password: "yourPassword" }, }, 'APIKEY': apiKey, 'APISECRET': apiSecret, 'test': true, useServerTime: true });
But it dit not work for ws connection,the log indicated that the connection timeout.
There are my logs:
[ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ] [ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ] [ 'Futures WebSocket error: btcusdt@miniTicker (ETIMEDOUT) connect ETIMEDOUT 31.13.69.160:443' ] [ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ] [ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ] [ 'Futures WebSocket error: btcusdt@miniTicker (ETIMEDOUT) connect ETIMEDOUT 111.243.214.169:443' ] [ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ] [ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ]
bump, i have same problem
I can config successfully in http with username and password.
_binance = new BinanceApi().options({ proxy:{ host:"p.webshare.io", port:"80", auth: { username: "yourUserName", password: "yourPassword" }, }, 'APIKEY': apiKey, 'APISECRET': apiSecret, 'test': true, useServerTime: true });
But it dit not work for ws connection,the log indicated that the connection timeout.
There are my logs:
[ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ] [ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ] [ 'Futures WebSocket error: btcusdt@miniTicker (ETIMEDOUT) connect ETIMEDOUT 31.13.69.160:443' ] [ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ] [ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ] [ 'Futures WebSocket error: btcusdt@miniTicker (ETIMEDOUT) connect ETIMEDOUT 111.243.214.169:443' ] [ 'Futures WebSocket closed: btcusdt@miniTicker (1006)' ] [ 'Futures WebSocket reconnecting: btcusdt@miniTicker...' ]
bump, i have same problem
I met the same problem too
seems there is no way to use proxy
option in websocket connection, only process.env.https_proxy
and process.env.socks_proxy
are accepted.
can't use custom proxyAgent either.
import Binance from 'node-binance-api';
import tunnel from "tunnel";
const proxy = tunnel.httpsOverHttp({
proxy: {
host: 'localhost',
port: 8080,
proxyAuth: "",
},
});
// doesn't work
const binance = new Binance().options({
proxy: proxy,
});
Proxy module is needed,especially the ws proxy.Now this is my proxy for http:
But i dont know how to deal with the ws proxy for websocket?