(ws) ws echo_server gains a new option (-p) to disable responding to pings with pongs
This commit is contained in:
@ -16,7 +16,8 @@ namespace ix
|
||||
const std::string& hostname,
|
||||
const ix::SocketTLSOptions& tlsOptions,
|
||||
bool ipv6,
|
||||
bool disablePerMessageDeflate)
|
||||
bool disablePerMessageDeflate,
|
||||
bool disablePong)
|
||||
{
|
||||
spdlog::info("Listening on {}:{}", hostname, port);
|
||||
|
||||
@ -35,6 +36,12 @@ namespace ix
|
||||
server.disablePerMessageDeflate();
|
||||
}
|
||||
|
||||
if (disablePong)
|
||||
{
|
||||
spdlog::info("Disable responding to PING messages with PONG");
|
||||
server.disablePong();
|
||||
}
|
||||
|
||||
server.setOnConnectionCallback(
|
||||
[greetings](std::shared_ptr<ix::WebSocket> webSocket,
|
||||
std::shared_ptr<ConnectionState> connectionState) {
|
||||
|
Reference in New Issue
Block a user