dparlevliet / node.bittrex.api

Node Bittrex API is an asynchronous node.js library for the Bittrex API, the data can be received either via GET request or Stream.
MIT License
253 stars 100 forks source link

Error Message: Negotiate Unknown #153

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, first of all thanks for your work :)

Since this morning I have a problem with websockets, i get this message:

Error Message: Negotiate Unknown Exception: undefined Error Data: 503

I know it has something to do with cloudfare but cloudscraper is used.

Do you have any idea?

cryptogearbox commented 6 years ago

I'm experiencing the same thing and it's definitely CloudFlare. It helped when I added a different referrer and user agent as a third argument into the cloudscraper function. I forked the code and tried different referrers. Using Microsoft Edge as the agent worked for me last night but Chrome and Firefox both did not.

{'Referer': 'https://www.google.ca', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393'});

This is a hit or miss solution.

I hope to find a more permanent solution soon.

kristopherlarson commented 6 years ago

I'm having the same issues..

ghost commented 6 years ago

in the file : node.bittrex.api.js line ~215 function cloudscraper.get('https://bittrex.com/', callback of ~100 lines, {'Referer': 'https://www.google.ca', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393', 'cookie': '__cfduid=check_browser_console; cf_clearance=check_browser_console'}

);

return wsclient;

};

Ok i put cookie yesterday but now it doesn't work anymore See posts below for the solution.

cryptogearbox commented 6 years ago

It will help a lot of others out if they can pass this argument in from the official package. If that user agent fails, you can pick and choose from a bunch here : https://developers.whatismybrowser.com/

dagli commented 6 years ago

When I added the standart browser headers like Accept-Encoding, Accept-Language etc, it worked.

{ 'Referer': 'https://www.google.fr', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko)', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'fr-FR,en-US;q=0.9,en;q=0.8', 'Cache-Control': 'no-cache', 'Upgrade-Insecure-Requests': 1, 'Pragma':'no-cache', }

rclai commented 6 years ago

We should be able to pass those extra headers via .options() so that it gets passed to the cloudscraper's third argument.