in reply to Use Protocol::WebSocket::Client in HTTPS mode?
Maybe look at how Net::Async::WebSocket::Client does its thing. It uses Protocol::WebSocket to drive the protocol. Alternatively, take a look at how Mojolicious implements its stuff.