I am working on a websocket client tool which has to establish thousands of parallel connections with the server. I have implemented that using tokio websockets with native TLS. It works fine up to 100 connections, but when I try to run it to establish 1000 connections, I get a lot of failures. It appears to be very slow even with multi_thread configuration. It tries to do a TCP handshake for all 1000 connections and really goes for TLS handshake after a long time causing server to drop the connection. The tool doesn't perform any activity other than the standard stuff establish a secure websocket connection.
Please suggest a good websocket crate which can support large number of secure websocket connections in parallel.