Fix client mask generation
random.randrange() gives integers, which need to be explicitly converted to bytes.
This commit is contained in:
parent
bccf1dd258
commit
a2362da1b7
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue