P5 node server with socket.io and websocket protocoll

I have created a P5 server node with socket.io. at locahost: 4000. I can also connect to it from the wifi network of my devices ( laptop, mobile).
Can I integrate websocket protocol for communication with esp32 device in another port ??? eg 8000 ???