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.

To reproduce the bug locally:
 - Launch Cloud9 on a local port.
 - Forward traffic from another port to this one
(Example to forward 1235 to 1234:
 ssh -f 127.0.0.1 -L 1235:127.0.0.1:1234 -N )
 - Connect to the forwarded port, and inspect the HTTP requests made by smith.io => Requests will be made on the local port instead of the forwarded one, making it unusable in a real proxy'ed environment.