switched socket address to location.origin, to allow using on a server