How to separate the socketio connection by the path of the URL in my flask chat app

Solution
from flask import Flask, render_template, session
from flask_socketio import SocketIO, send, join_room

@socketio.on('message')
def handleMessage(msg):
    print('Message: ' + msg)
    send(msg, broadcast=True, to = session['club_code'])
    
@socketio.on('connect')
def connect():
    join_room(session['club_code'])

@app.route('/chat/')
def chat(club_code):
    session['club_code'] = club_code
    return render_template('chat.html',club_code=club_code)