When I changed to HTTPS on AWS, the communication of the chat function I created was immediately disconnected ...
If you do nothing for about 1 minute, it will disconnect.
It seems that the load balancer setting is the cause.
Since the idle timeout setting is 60 seconds by default, WebSocket will be disconnected in 60 seconds if nothing is done.
So change the settings.
From the AWS console, "EC2" → "Load Balancer"
In "Edit Attribute", change the idle timeout value from 60 seconds to the time you do not want to be disconnected.
Done.
This will not disconnect until the set time.