Skip to main content

wstompy

Using a transport agnostic protocol and websocket-client to speak STOMP over websocket.

Features

Yes

  • STOMP 1.2
  • Websocket with SSL/TLS(wss://) from websocket-client
  • Verbose socket logging thanks to websocket-client websocket.enableTrace(True)
  • Custom headers for transport and protocol

No

  • A non-websocket client

No, until added

  • STOMP versions before 1.2
  • Data Classes/Models
  • Ready for production

Instructions

Install

pip install wstompy

Usage

import websocket
from wstompy.connection import WebSocketStompClient

websocket.enableTrace(True)

access_token = 'tokentokentoken'
host = 'localhost'
url = f'ws://{host}:8080/ws/websocket'
client = WebSocketStompClient(
    header_host=host,
    socket_url=url,
    custom_headers={'Authorization': f'Bearer {access_token}'},
    subprotocols=['v12.stomp']
)
client.run_forever(suppress_origin=True)

Collaboration

  • Submit polite and/or well-written tickets for issues.
  • Fork and submit PRs referencing issues.
  • Uses poetry because they were early with pyproject.toml implementation which is neater when publishing.
  • Testing, feedback and reporting on usage with different server implementations.
  • Code is expected to have been run through black before commits, see Makefile.

Family, extended relatives and inspirations

  • stomp.py - tried but its run loop was too sticky using dunders, preventing an easy merge with websocket-client's run loop.
  • stomper - didn't have STOMP 1.2 implemented and I figured it was just as easy to reimplement to have the possibility of adding custom headers.
  • stompest - didn't try it, but has async support in its packaged client.

Developing

  • flake8 wstompy/ config in .flake8 until they support pyproject.toml
  • mypy wstompy/ config in pyproject.toml
  • black wstompy/ config in pyproject.toml

Notes

Release files for wstompy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wstompy 0.1.0
File Size Uploaded
wstompy-0.1.0.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wstompy 0.1.0
File Interpreter ABI Platform
wstompy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 kB

Release files / wstompy-0.1.0.tar.gz

Download URL wstompy-0.1.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3c84713940d3885c99dd16d471c8237bf4ea0d1107ac2341a619adc8e7542ba8
BLAKE2b-256 checksum
How to use checksums
2062a5a391493674961f3026bd8ac38a800add975c17039f0b4468f650c21c59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.10 Linux/5.4.0-90-generic

Release files / wstompy-0.1.0-py3-none-any.whl

Download URL wstompy-0.1.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87b0de5d0e784330c333936f61fb1874dc12b9c9bbc4b8e5894b4b65e56996b8
BLAKE2b-256 checksum
How to use checksums
41c8be847d4c4b726d935e3e830516fc1adb202b279c9f34f0cbde02b5c40cdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.8.10 Linux/5.4.0-90-generic

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page