Rasa 2.0 socketio connecting but not recieving or sending back messages

Hey I was able to properly connect socket.io client to rasa and it logs the session id in debug mode but for some reason I can not get messages to and from rasa using socket.io. I have reset the project and had the base rasa init without anything added other than uncommenting socketio: in the credentials yaml. What am I doing wrong?

    const socket = io("ws://localhost:5005/socket.io");
    
    socket.on('bot_uttered', msg => console.log('response', msg));
    socket.on('connect', function () {
        console.log('Socket connected', socket.connected, socket.id);
        this.emit('user_uttered', { message: 'hello' });
    });

command: rasa run --connector socketio --cors "*" --enable-api --debug

also tried: rasa run --enable-api --debug

Logs: DEBUG rasa.core.channels.socketio - User d07e8dbe76b0478fbbfc9105d26ff227 connected to socketIO endpoint.

but no other logs after.

Sometimes I will get the error when i ctrl-c exit rasa: ERROR asyncio - Task was destroyed but it is pending!

Self answered

Figured out what the issue was, I needed to add the desired socket io options:

    const socket = io("ws://localhost:5005", {
        pathname: '/socket.io',
        transports: ['websocket'],
    });
2 Likes