Add pure Websockets as custom channel

I read the Rasa docs for creating a custom channel, but they are only for REST. I need to create a custom channel that utilizes websockets, so I checked out the code for the connector. The way and websockets are used in python are very different, so how would I implement something like this? @erohmensing

Realized I could create websocket routes with sanic.

Hi Adam,

I am currently at the same point and would highly appreciate if you would share how you did it.

All the best


Here’s an attachment of my channel code. In my implementation, rasa is a websocket client that connects to a NodeJs websocket server. It’s a lot easier if you want rasa to act like a websocket server instead, since you can do something like this (from the sanic documentation). (6.8 KB)