Giter VIP home page Giter VIP logo

Comments (6)

TitoDra avatar TitoDra commented on June 27, 2024 1

I got the same.

Replace :
if 'header' not in options or 'Sec-WebSocket-Key' not in options['header']
By : options.get("header") or 'Sec-...'

from python-hotbit.

bazickoff avatar bazickoff commented on June 27, 2024

I have the same error

from python-hotbit.

jasongoodwin avatar jasongoodwin commented on June 27, 2024

I'm trying requestsWS = 0.0.17 - looks like a bug in requestsWS.
You'll have to update this project as well and install it eg from local after changing setup.py
Just trying this now to confirm that works.

from python-hotbit.

jasongoodwin avatar jasongoodwin commented on June 27, 2024

jona799t/RequestsWS@e3ff729#diff-78617859ccafcb839d3ac7c1c92526fdfab228b4f99006745a54bc7d967270fdR16
You can see the source of the issue here

from python-hotbit.

jasongoodwin avatar jasongoodwin commented on June 27, 2024

There is another error though.

---------------------------------------------------------------------------
SSLError                                  Traceback (most recent call last)
/var/folders/zs/51hgdy9d57z10362cmsc12800000gn/T/ipykernel_55560/2428402997.py in <cell line: 1>()
----> 1 client.serverTime()

~/Development/src/python-hotbit/hotbit/reverseApi.py in serverTime(self)
     54             "id": 10
     55         }
---> 56         resp = self.sessionWS.post('wss://ws.hotbit.io/', json=payload, encryption="gzip", identifiers={"id": 10})
     57         return resp.json()
     58 

~/opt/anaconda3/lib/python3.9/site-packages/requestsWS/session.py in post(self, wsUrl, headers, encryption, data, json, waitForResponse, identifiers, timeout, debug)
    126 
    127     def post(self, wsUrl, headers={}, encryption=None, data=None, json=None, waitForResponse=True, identifiers=None, timeout=None, debug=False):
--> 128         resp = _post(ws=self.ws, wsUrl=wsUrl, wsData=self.wsData, headers=headers, encryption=encryption, data=data, json=json, waitForResponse=waitForResponse, identifiers=identifiers, timeout=timeout, debug=debug)
    129         self.ws = resp.ws
    130         self.wsData = resp.wsData

~/opt/anaconda3/lib/python3.9/site-packages/requestsWS/session.py in __init__(self, ws, wsUrl, wsData, headers, encryption, data, json, waitForResponse, identifiers, timeout, debug)
     69 
     70         dataFormatted = JSON.dumps(data) if type(data) == dict else data if data != None else JSON.dumps(json)
---> 71         ws.send(dataFormatted)
     72         self.status_code = 200
     73 

~/opt/anaconda3/lib/python3.9/site-packages/websocket/_core.py in send(self, payload, opcode)
    276 
    277         frame = ABNF.create_frame(payload, opcode)
--> 278         return self.send_frame(frame)
    279 
    280     def send_frame(self, frame):

~/opt/anaconda3/lib/python3.9/site-packages/websocket/_core.py in send_frame(self, frame)
    304         with self.lock:
    305             while data:
--> 306                 l = self._send(data)
    307                 data = data[l:]
    308 

~/opt/anaconda3/lib/python3.9/site-packages/websocket/_core.py in _send(self, data)
    518 
    519     def _send(self, data):
--> 520         return send(self.sock, data)
    521 
    522     def _recv(self, bufsize):

~/opt/anaconda3/lib/python3.9/site-packages/websocket/_socket.py in send(sock, data)
    168             return sock.send(data)
    169         else:
--> 170             return _send()
    171     except socket.timeout as e:
    172         message = extract_err_message(e)

~/opt/anaconda3/lib/python3.9/site-packages/websocket/_socket.py in _send()
    145     def _send():
    146         try:
--> 147             return sock.send(data)
    148         except SSLWantWriteError:
    149             pass

~/opt/anaconda3/lib/python3.9/ssl.py in send(self, data, flags)
   1171                     "non-zero flags not allowed in calls to send() on %s" %
   1172                     self.__class__)
-> 1173             return self._sslobj.write(data)
   1174         else:
   1175             return super().send(data, flags)

SSLError: [SSL: BAD_LENGTH] bad length (_ssl.c:2483)

from python-hotbit.

jona799t avatar jona799t commented on June 27, 2024

Hi,

Sorry about the late response, I am currently on vacation.

Did you figure it out? If not then maybe try these commands in the following order:

pip install hotbit --upgrade 
pip install requestsWS --upgrade
pip install websocket-client --upgrade

If it didn't work try joining our Discord since we have some amazing people there who are happy to help.

Best Regards,
Jonathan

from python-hotbit.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.