So are you sure you don't need to have port_number in the url?
port_number
const socket = new WebSocket("wss://<server ip>:<port_number>/ws/chat/?first_user=19628&second_user=19629", ["Bearer", token]);