[Python] Autobahn sending user specific and broadcast messages from external application

Discussão em 'Python' iniciado por Stack, Julho 10, 2025.

  1. Stack

    Stack Membro Participativo

    Totally new to websockets.

    I am having a bit of trouble understanding how to interact with python Autobahn / twisted from another application and cannot seem to find any useful examples.

    I have a Python application running that needs on certain events to send one of two types of messages. The first is a broadcast message to all users. The second type is to a single specific user.

    Using the following two examples I can receive messages and send a response. However I do not need to receive anything from connected clients (other than clients connecting to the websockets server) only send to them.

    I have played with: https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo

    Also (non Autobahn related): https://github.com/opiate/SimpleWebSocketServer

    Questions:

    1 - Is what I am trying to do possible? Can I have an external application that connects with the Autobahn application / server and broadcasts messages to all connected users or a single user.

    2 - If possible can someone point me in the right direction to learn how this can be done?

    Thanks

    Continue reading...

Compartilhe esta Página