title: What IP address to use on client-side using socket.io for production?
body: <p>The code that I am using right now is : </p>
  
  <pre><code>    &lt;!--Socket.io --&gt;
      &lt;script src='http://172.16.17.185:3000/socket.io/socket.io.js'&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Where, 172.16.17.185 is the IP address on our LAN on which my server runs and port 3000 is used for socket.io communication. </p>
  
  <p>The examples on the socket.io website use localhost in place of the server IP address. I started with this. Using localhost, my page loaded fine on the server, but no other PC on the LAN was able to create the socket object (as it was trying to look for socket.io on its localhost, which wasnt there). </p>
  
  <p>So, I changed localhost to the IP address of the server, and everything worked fine. </p>
  
  <p>Until, I tried accessing it from outside. Since this IP address is valid only on the LAN, it doesnt work like it should on the internet. </p>
  
  <p>Is there a workaround for this problem ? or do I need to find the public IP of the server and use it ? Does this create any security vulnerabilities for the server as I dont have authorization ?</p>
  
  <p>So far: <a href="http://www.ipsacademy.org/weather" rel="nofollow">http://www.ipsacademy.org/weather</a></p>
  
  <p>Server code in <a href="https://github.com/chintanp/weather_station/blob/master/angulared/web_server.js" rel="nofollow">web-server.js</a></p>