Socket
Socket
Sign inDemoInstall

wstompy

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wstompy

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


Maintainers
1

Readme

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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc