socket: fix issue with baseURI and port Reconnect to AMD

fixes #17661

(cherry picked from commit fe64cc6e45f5f15924e2d60bdec0bdfc600d6397)

Conflicts:
	socket.js
	socket/Reconnect.js