I referenced here documents about boost::beast websocket-async.
I removed "ws_.async_close(websocket::close_code::normal..." on on_read function in order to avoid disconnection.
But beast websocket is disconnected by ending on_read.
std::make_shared<session>(ios)->run(host, port, text);
ios.run(); // I want to keep running it until explicit calling close.
Replace the code
with the logic you want. What do you want to happen instead? Do you want to read more? Then do another read like above: