-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: can't concat int to bytes #574
Comments
Thanks for your report. I'm afraid the client code is rarely used, so it is likely to have more bugs. Does this fix work: diff --git a/websockify/websocket.py b/websockify/websocket.py
index dae93b4..af87d3e 100644
--- a/websockify/websocket.py
+++ b/websockify/websocket.py
@@ -731,7 +731,7 @@ class WebSocket(object):
if self.client:
mask = b''
for i in range(4):
- mask += random.randrange(256)
+ mask += random.randrange(256).to_bytes()
frame = self._encode_hybi(opcode, msg, mask)
else:
frame = self._encode_hybi(opcode, msg) |
It should do, but we've moved to websocket-client |
Okay. I've pushed the above fix as a2362da. Hopefully it is sufficient to fix the client side. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got this error:
https://github.com/novnc/websockify/blob/master/websockify/websocket.py#L732-L734
Here it tries to concatenate an integer to a byte string, what raises a type error.
The text was updated successfully, but these errors were encountered: