omnia-network / ic-websocket-gateway

WebSocket gateway for the IC
https://status.icws.io
MIT License
24 stars 2 forks source link

Accept TLS connection in a separate task from the WS listener #13

Closed massimoalbarello closed 11 months ago

massimoalbarello commented 11 months ago

The TLS handshake might take several seconds to complete and the WS listener should not be blocked by this. For this, we perform the handshake in a separate task and then communicate the resulting stream to the WS listener once it is ready. In the meantime, the listener can listen for other incoming connections.