update host for sockets
added location.origin on client side