Listening to adonis Websocket from Python websocket


I have a websocket server in adonis and want to access it using python’s websocket listener.

Is there a way to do so?

If so, please provide as example.

Thanks in advance


Whenever you connect to the websocket server, the connection is considered as a client connection.

AdonisJs does ship with a client implementation for browsers. However for python, you’ll have to write it yourself and here is protocol on how to do it


Thank you very much!!! Really enjoyed using adonisjs in production!!

All my projects now use adonis as backend!!


Following is the Python code for a client for the adonis websocket. Just posted it for anyone looking ofr answers, just like me!!!

import json
from websocket import create_connection
ws = create_connection(“ws://link_to_ws_server:port_no/adonis-ws”)
“t”: 1,
“d”: { “topic”: ‘channel_name:topic_name’ }
while True:
result = ws.recv()
result = json.loads(result)
print (“Received ‘%s’” % result)