Socketio part whuch handle user input and output message to user

Hi, I want to connect my Rasa X to a live chat. But I cant find out which part of socketio sourcecode should change. Rasa will ask user whether want to chat with live agent or not. After user press buttons, I want to store the sender id, channel and live_chat, either true or false in redis. If user want to chat with live agent, the connections between user and rasax will cut down, the message will send directly to live agent. Can anyone help me with this? Thank you !!