0

I need help from the expert and feels like this is beyond my paygrade. I have xampp installed on a windows machine. I have a php page that i access using https://example.com/test.php and inside that php page, it calls a javascript. It did not worked. I got this error:

can’t establish a connection to the server at wss://example.com:8080/

But the everything seems to be working when I access the page as http://example.com/test.php and calls the WebSocket('ws://example.com:8080'). Did I missed anything on my httpd conf?

Thank you

tebong
  • 1
  • 1
  • You need to connect to the HTTPS port, not the HTTP port. – tkausl Jul 24 '22 at 17:36
  • And which one _is_ your `https` url? `mydomain.com:8080` clearly isn't. – tkausl Jul 24 '22 at 17:58
  • sorry i forgot to mentioned that yes i was access the url using a https and not http. When i tried to connect, i am getting this error : can’t establish a connection to the server at wss://mydomain.com:8080/. – tebong Jul 24 '22 at 18:01
  • I got that, but again, `mydomain.com:8080` _is the wrong URL_. There is a HTTP server listening on that port, not an HTTPS server. – tkausl Jul 24 '22 at 18:02
  • hi Tkausl, I just rewrote the question to be more specific. – tebong Jul 24 '22 at 18:13
  • It just got more confusing. What exactly is listening on port 8080? – tkausl Jul 24 '22 at 18:14
  • listening port is port 8080. should i use a different port instead? – tebong Jul 24 '22 at 18:17
  • __What__ is listening on port 8080? `listening port is port 8080` How do you know? You have to be a bit more specific about how you got this URL and why you think this is the correct port. – tkausl Jul 24 '22 at 18:22
  • Thank you Tkausl. Your answer pointed me to the right direction. I found this finally and got it to work. https://stackoverflow.com/questions/16979793/php-ratchet-websocket-ssl-connect – tebong Jul 24 '22 at 18:45

0 Answers0