WebSockets: wss from client to Amazon AWS EC2 instance through ELB

前端 未结 2 917
清歌不尽
清歌不尽 2021-02-02 14:18

How can I connect over ssl to a websocket served by GlassFish on an Amazon AWS EC2 instance through an ELB?

I am using Tyrus 1.8.1 in GlassFish 4.1 b13 pre-release as my

2条回答
  •  天涯浪人
    2021-02-02 14:37

    I had a similar setup and originally configured my ELB listeners as follows:

    • HTTP 80 HTTP 80
    • HTTPS 443 HTTPS 443

    Although this worked fine for the website itself, the websocket connection failed. In the listener, you need to allow all secure TCP connection as opposed to SSL only to allow wss to pass through as well:

    • HTTP 80 HTTP 80
    • SSL (Secure TCP) 443 SSL (Secure TCP) 443

    I would also recommend raising the Idle timeout of the ELB.

提交回复
热议问题