GithubHelp home page GithubHelp logo

Comments (5)

clue avatar clue commented on June 7, 2024

Hey @kamyabsoft, welcome to ReactPHP! 👋

Failed to listen on "tcp://127.0.0.1:8080": Address already in use

This indicates some other process is already listening on this address (like some other Apache or nginx process). This means that ReactPHP was unable to listen on this address. Accordingly, trying to connect to this address will actually connect to that other process instead of ReactPHP.

You can try another port number or use the special port 0 to automatically assign a random free port. You can then use $socket->getAddress() to get the assigned address.

I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can always reopen this 👍

from reactphp.

kamyabsoft avatar kamyabsoft commented on June 7, 2024

Thanks for your guidance
The method $socket->getAddress() show me free port 37423 and i us this port in my code
But again, the loading of the site was infinite for the first time. I clicked on the site address again and it gave the same error as above and not echo hello world
my adress : http://103.215.221.123/

from reactphp.

clue avatar clue commented on June 7, 2024

You will need to change to your listening address to your public IP or the special address 0.0.0.0:0 to listen on a random port on all interfaces. It may always assign a different port, but in your example you should be able to send a request to http://103.215.221.123:37423/.

Also, are you running this example from the command line? Note that this should not be embedded into a "normal" PHP script using a traditional SAPI like Apache/nginx. The script will keep running forever and you should be able to connect to it as long as the process is running. You may also have to check your firewall settings if external connections are somehow restricted.

from reactphp.

kamyabsoft avatar kamyabsoft commented on June 7, 2024

Thank you very much for solving my problem .
with my isp My site address is easily loaded and shows the text Hello World
but for my friends ( check with two different isp ) my page not load . do you know why ?
website : http://103.215.221.123:37423/

from reactphp.

clue avatar clue commented on June 7, 2024

@kamyabsoft Happy to hear you're making some progress.

The remaining problem you're describing sounds more like a firewall issue than a problem with ReactPHP. To isolate this issue, you may also try running another server process such as nc -l 0.0.0.0 37423 and see if a connection can be established.

from reactphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.