This is not a Cordova adding a port to your URL, it is a socket.io client, here :
this.port = opts.port || (global.location && location.port ? location.port : (this.secure ? 443 : 80));
If no port is specified, the default port is the application port. This is probably an error in socket.io, as it only makes sense if the web page and server are hosted from the same node. Your problem arises because it is a cord that serves your application (on localhost: 8000) and socket.io assumes that websocket will be on the same port.
To avoid this, you should add a port to the URL or opt ion object.
Koder source share