Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1034225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:21:20+00:00 2026-05-16T14:21:20+00:00

I followed the HTML5 Websocket tutorial of the website below: http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/ It worked well,

  • 0

I followed the HTML5 Websocket tutorial of the website below:

http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/

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”.

It turns out that I can view the page in browser(apache) with http protocol, for example “http://218.175.192.160:8080/client.html“, however, the socket in client-side can not connect to “ws://218.175.192.160:8080/daemon.php”.(editted typo)

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”?

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.

Please help, Thank you.

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.

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.

sorry that i forgot the basic network setting 🙁 , hope this post helps the network newbie like me, thx~ 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:21:21+00:00Added an answer on May 16, 2026 at 2:21 pm

    I had this problem as well.

    The problem is you are most likely referring to your ROUTER’s IP address. What you need to do is refer to your COMPUTER’s IP address.

    It works for localhost because localhost points to your individual computer and not your router.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed a couple of tutorials (http://www.adobe.com/devnet/html5/articles/javascript-motion-detection.html, http://www.html5rocks.com/en/tutorials/canvas/notearsgame/ ) and spliced the two
i had followed exactly same procedure on google's tutorial: http://developer.android.com/guide/tutorials/views/hello-mapview.html ...while i got force
I followed http://www.beakkon.com/tutorial/html5/desktop-notification tutorial for html 5 desktop notifications. The demo on that page
so I followed an HTML5 drag and drop example here: http://www.html5rocks.com/en/tutorials/dnd/basics/#toc-dataTransfer and created the
I have followed this tutorial ( http://developer.android.com/resources/tutorials/views/hello-tabwidget.html ) and completed the task and it
I followed this tutorial http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html I wrote the manifest File giving all the permissions
I followed this great tutorial toajax my blog: http://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.html But it creates some problems
I have followed this tutorial: http://www.phpjabbers.com/how-to-make-a-php-calendar-php26-6.html#comments to make a very basic calendar. My aim
I followed the simple tutorial @ http://www.devart.com/dotconnect/oracle/articles/Tutorial_EF.html (Which works perfectly, btw) combined with http://www.hanselman.com/blog/CreatingAnODataAPIForStackOverflowIncludingXMLAndJSONIn30Minutes.aspx
I've followed instructions http://code.google.com/webtoolkit/doc/latest/tutorial/gettingstarted.html in order to create sample GWT program. Now I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.