-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Https (wss) error on connection #886
Comments
Change $ws_worker = new Worker('websocket://psql.site.ru, $context);
to $ws_worker = new Worker('websocket://0.0.0.0:443, $context);
and try again. |
THANK YOU VERY MATCH!!!!! Finally the problem is solved please tell me why this option works, but not with the domain name? |
Domain name only works if you have it defined in your servers Hosts file (first mechanism for domain name resolving to IP by OS). There can be three IP's, 127.0.0.1 (e.g. localhost in your When you set the address to |
if you need ip use $ip = gethostbyname('psql.site.ru');
$ws_worker = new Worker("websocket://{$ip}443", $context); |
Hello. I have been struggling to launch a project on https for a long time. Using the http option and using the server's IP, everything works.
I have a subdomain like psql.site.ru
I start the worker using the code:
The certificate files are valid and their paths are correct. Rights exhibited 666
On the frontend side connect:
When i connect, i get an error:
WebSocket connection to 'wss://psql.site.ru:2346/?token=123' failed:
And i get an error in "onerror" event:
And i get error in "onclose":
I use standard ports 2346 for connection. But when I change the ports to others (for example, 2246), the error does not immediately occur. It occurs when I try to send something to the server. I get an error like:
Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
Help please, can this error be due to the fact that the subdomain is used? Or was the certificate issued via lets encrypt ?
I will be very grateful, I have been trying to solve the problem for several days
The text was updated successfully, but these errors were encountered: