question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ws:// works well, but wss:// connection failed.

See original GitHub issue
  • I’ve searched for any related issues and avoided creating a duplicate issue.

Description

Connecting on ws:// works well but wss:// doesn’t. If I try to connect to wss://, then an error occurs:

WebSocket connection to ‘wss://[host]/’ failed

I think it’s not a problem about my server but ws because when I run my server on HTTPS then it works well.

How do I figure it out? or any tips to debug the problem in ws?

Thank you for viewing my question.

Reproducible in:

  • version: 7.5.3
  • Node.js version(s): 16.6.0
  • OS version(s): Amazon Linux

Attachments:

I’ve also asked this in more detail on Stack Overflow: https://stackoverflow.com/questions/68745030/websocket-aws-websocket-connection-to-wss-host-failed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
lpincacommented, Aug 11, 2021

@charlieheslington if you are running this https://github.com/websockets/ws#external-https-server, then it can’t work with ws:// as it only accepts TLS connections.

If you are using a TLS terminating reverse proxy / load balancer like @ygnoh make sure it correctly forwards the upgrade requests to the WebSocket server.

0reactions
lpincacommented, Aug 12, 2021

I’m closing this as answered. Discussion can continue if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket connection on wss failed - Stack Overflow
Now, I am trying to establish a socket connection using wss, but it failed. The error at the Javascript client side is like...
Read more >
WebSocket connection to 'wss://[host]/' failed - Server Fault
In the EC2 instance, when I run an HTTPS server which shows "hello world" as a text, it works well in a client...
Read more >
WebSocket connection failed. Error in browser console, since ...
I know this is closed, I have trying to establish connection to wss using apache httpd on Oracle Linux 8 and i keep...
Read more >
WebSocket connection to 'wss://...' failed. ASP .Net Core Web ...
The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not...
Read more >
WebSocket Connection to 'wss://mydomain' - Failed (wss)
I'm using laravel forge to deploy and projects works fine in localhost but doesn't work after deploying to laravel forge. enter image description...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found