changed it to use the window.location.host to get the server ip rather than hard coding it to localhost.