I’ve made a websocket server with websocketpp (C++), and a websocket client in PHP. When I test it on my local machine it works: the client can connect to the server and they can send each other some data.
Then I placed the server-script on my server and compiled it there. After compiling it is running and “working”: the server is also a client of another server, these connect and transfer data. However, my PHP client cannot connect to the C++ websocket server. I actually do not know which host URL to use. I’ve tried these:
ws://www.url.nl:port/folder/program-name
ws://www.url.nl:port/
ws://www.url.nl:port/program-name
How can I refer to my server?
I hope my problem is clear, but feel free to ask for clarifications if needed.
Then your url schould be
ws://www.url.nl:port/Make shure there is no firewall on your server/network which blocks your request. You can do this by running
telnet www.url.nl port. If you have access to netcat usenc -v www.url.nl portthis would give you much more verbose information on your connection status.It would be very helpfull if you have any error messages. 😉
EDIT running service:
Make shure your service is running and listen on correct network interface and port.
use
netstat -tulpenon linux ornetstat -anoon windowsEDIT check your firewall rules:
iptables -L