title: HTML5 Websocket only works on localhost
body: <p>I followed the HTML5 Websocket tutorial of the website below:</p>
  
  <p><a href="http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/" rel="noreferrer">http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/</a></p>
  
  <p>It worked well, then I changed the host value from "localhost:8080" to "218.175.192.160:8080" (my ip) in client-side page, the server side still kept "localhost:8080".</p>
  
  <p>It turns out that I can view the page in browser(apache) with http protocol, for example "<a href="http://218.175.192.160:8080/client.html" rel="noreferrer">http://218.175.192.160:8080/client.html</a>", however, the socket in client-side can not connect to "ws://218.175.192.160:8080/daemon.php".(editted typo)</p>
  
  <p>my questions are:
  1.
  in client side, why does websocket only work on "ws://localhost:8080/daemon.php", not "ws://218.175.192.160:8080/daemon.php"?</p>
  
  <p>2.
  why socket_bind( $socket, "127.0.0.1", 8080 ) works,
  but socket_bind( $socket, "218.175.192.160", 8080 ) occur error?
  the system reminds "unable to bind address [0]: The requested address is not valid in its context". I am sure that the Ip address belongs to my server.</p>
  
  <p>Please help, Thank you.</p>
  
  <p><strong>I had found out the reason of the error: binding the wrong address, becasue i used router, even though i had set NAT service on router, but i forgot the address of "218.175.192.160" is belonging to the interface of router, not my server machine.</strong></p>
  
  <p><strong>the address of server machine should be the local address type, for example: "192.168.1.2", which is really on the lan card interface.</strong></p>
  
  <p><strong>sorry that i forgot the basic network setting :( , hope this post helps the network newbie like me, thx~ :)</strong></p>