Closed Spitfire1900 closed 7 months ago
Confirming, while WSStompConnection
supports a ws_path
argument, WSStompConnection
does not appear to ever be invoked.
Resolved
import os
from base64 import b64encode
import stomp
from dotenv import load_dotenv
load_dotenv()
password = os.environ['password']
username = os.environ['USERNAME']
conn = stomp.WSStompConnection(
[('example.com', 80)],
ws_path='/myapp/my_websocket_endpoint',
header={'Authorization': f"Basic {b64encode(f'{username}:{password}'.encode()).decode()}"}
)
conn.connect(wait=True, with_connect_command=True) # returns None
It doesn't appear from the API reference that stomp.py supports custom context paths, e.g.
localhost:80/myapp/my_websocket_endpoint