0

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
  • 101
  • 3
  • @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. – Yonggoo Noh Aug 11 '21 at 16:30
  • Check your application's logs, then. – Michael Hampton Aug 11 '21 at 16:34
  • @MichaelHampton I can't check any logs because the library prints nothing. :( – Yonggoo Noh Aug 11 '21 at 16:45
  • 1
    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. – NStorm Aug 11 '21 at 18:33
  • I'm sorry guys. this was my fault. An A record was wrong so the `wss` connection was failed. I'm sorry. – Yonggoo Noh Aug 11 '21 at 18:42
  • what exactly was wrong with A record? – Pavlo Pastushok Nov 04 '21 at 18:45

0 Answers0