How does the ws module distinguish between different routes on the client?

if the client needs two websocket, and cannot get through the websocket connection under different routes, do you need to open two ports:

const WebSocket = require("ws");

const wss1= new WebSocket.Server({ port: 8080 });
const wss2= new WebSocket.Server({ port: 8081});
Mar.19,2021
Menu