crossbario / crossbario/autobahn-python

Websocket: send binary message from memoryview() or bytes-like object

Open
#877 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-discussion websocket
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

I have a python Twisted webserver that communicates with a JS client over websockets. I would like to send binary messages from a memoryview() - but autobahn has an assert() that the source of sendMessage must be type == byte.

Could sendMessage accept memoryview, or any 'bytes-like' object?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the sendMessage entry point and trace the validation applied to its source argument. Confirm how binary messages are handled for the Twisted WebSocket path, then verify that memoryview and other bytes-like inputs are accepted without changing binary-message behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.