I’ve been trying to get my WebSocket server (using Ratchet in PHP) running for the better part of the day, I feel like I’ve tried everything and still no luck. When I try and connect to the WebSocket server in JS it just takes ages and then it times out, essentially, the server accepts the connection (I don’t immediately get a connection refused error) but then does nothing.
I’m running a 14.04 Ubuntu with a LEMP stack. I have found loads of nginx configurations to make this work, but none of them worked for me. The strange thing is that it works perfectly fine locally with my Virtual Machine, which is running a LEMP stack as well, with virtually the same nginx configuration. I never needed to configure anything in my nginx to make websockets work.
I’m completely lost, and any help would be really appreciated!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!