Score:0

WebSocket connection to 'wss://[host]/' failed

ru flag

Environment

First of all, I'm using AWS ALB, EC2 with Route 53. ALB is opened for HTTP, HTTPS and EC2 is also opened for All TCP.

And I'm using ws library to use websocket.

As an HTTPS server

In the EC2 instance, when I run an HTTPS server which shows "hello world" as a text, it works well in a client using https://.

As an websocket server

However when I run an websocket server instead of HTTPS server and try to connect to that from a client, the below error occurs:

WebSocket connection to 'wss://[host]/' failed

As a side note, in a client using http://, connecting to ws://[same hostname] works well.

What should I check? PLEASE HELP ME!

Yonggoo Noh avatar
ru flag
@MichaelHampton I'm using Node.js server with [`ws`](https://github.com/websockets/ws) websocket library and the socket server uses port 80. I know `wss://` uses 443 but ELB routes 433 to 80 so I use 80.
Michael Hampton avatar
cz flag
Check your application's logs, then.
Yonggoo Noh avatar
ru flag
@MichaelHampton I can't check any logs because the library prints nothing. :(
np flag
So basically you took just a library, wrote your code which doesn't works and you don't know how to debug it and now you are asking what's wrong? Even the simplest `ws` example right on the README has a `console.log` string which writes some debug info on connect. Rest is up to your code.
Yonggoo Noh avatar
ru flag
I'm sorry guys. this was my fault. An A record was wrong so the `wss` connection was failed. I'm sorry.
Pavlo Pastushok avatar
eg flag
what exactly was wrong with A record?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.