Skip to content

add WebSocketConnection class#177

Open
m2es3h wants to merge 7 commits intocommunity-of-python:mainfrom
m2es3h:feature/add_websocket_connection_class
Open

add WebSocketConnection class#177
m2es3h wants to merge 7 commits intocommunity-of-python:mainfrom
m2es3h:feature/add_websocket_connection_class

Conversation

@m2es3h
Copy link

@m2es3h m2es3h commented Feb 1, 2026

I have a use-case where I've been using the websocket adapter from stomp.py project (see stomp/adapter/ws.py in https://github.com/jasonrbriggs/stomp.py for reference).

I've recently switched to using stompman and added a WebSocketConnection class to support this use-case, based on your existing Connection class.

Known issue: no support for URL paths after the ws://hostname:port yet. Do I modify the existing stompman.config.ConnectionParameters, or create a websocket-specific ConnectionParameters? Not sure which way is preferred.

@vrslev
Copy link
Collaborator

vrslev commented Feb 1, 2026

Hi! This seems mostly fine. I can accept the PR if you adjust some stuff:

  1. Add optional-dependencies group and put websockets there so we can install it with: stompman[ws]
  2. Document it in README.md
  3. Add proper tests
  4. Install just and run just command to ensure proper formatting, linting, etc

Known issue: no support for URL paths after the ws://hostname:port yet. Do I modify the existing stompman.config.ConnectionParameters, or create a websocket-specific ConnectionParameters? Not sure which way is preferred.

Too much hassle to create websocket-specific connection parameters. let's compromise and modify existing connection parameters

@vrslev
Copy link
Collaborator

vrslev commented Feb 1, 2026

Also this new class should be in separate file so that import doesn't fail if you don't have websockets installed

@m2es3h
Copy link
Author

m2es3h commented Feb 8, 2026

I still need to follow-up with 3. Add proper tests, but I've implemented your suggestions above.

@vrslev
Copy link
Collaborator

vrslev commented Mar 2, 2026

Test is flaky, but type checking fails

@vrslev
Copy link
Collaborator

vrslev commented Mar 10, 2026

Great, CI is passing! Let’s also mention stompman[ws] in the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants