crossbario / crossbario/autobahn-python

WebSocket option to set max outgoing message/frame size

Open
#888 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement PRIO HIGH websocket
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

If you exceed the websocket payload limit when issuing an RPC call in WAMP it drops the connection and fails with 'WAMP transport was lost without closing the session before'. Turning on debug logging shows that it is an 1009 error on the other end, but it took me some time to get there - I think it would be great with a more detailed main error.

That said, in my case at least, I prefer it much to detect the error on the client side to avoid dropping the connection. For now I have solved it by adding the following to autobahn.wamp.websocket.WampWebSocketProtocol.send:

if len(payload) > self.maxFramePayloadSize:
raise ProtocolError(u'Message exceeds payload limit of {0}'.format(self.maxFramePayloadSize))
self.sendMessage(payload, isBinary)

maybe that would be of general interest?

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 in autobahn.wamp.websocket.WampWebSocketProtocol.send, where the issue shows checking payload length against maxFramePayloadSize before sendMessage. Review the surrounding WebSocket handling and determine how an outgoing size option and client-side error should behave; done means oversized WAMP messages are detected before the connection is dropped.

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.