Fix port number mismatch behind proxy

When C9 is used behind a proxy/forwarder that changes the HTTP port, engine.io became unusable.
This is due to the port number that was given to engine.io for the client to connect to: instead of giving it the document.location.port, the cloud 9 server port was given, resulting in the bug.