(WebSocketServer) add option to disable deflate compression, exposed with the -x option to ws echo_server
This commit is contained in:
12
ws/ws.cpp
12
ws/ws.cpp
@ -174,6 +174,7 @@ int main(int argc, char** argv)
|
||||
echoServerApp->add_option("--host", hostname, "Hostname");
|
||||
echoServerApp->add_flag("-g", greetings, "Verbose");
|
||||
echoServerApp->add_flag("-6", ipv6, "IpV6");
|
||||
echoServerApp->add_flag("-x", disablePerMessageDeflate, "Disable per message deflate");
|
||||
addTLSOptions(echoServerApp);
|
||||
|
||||
CLI::App* broadcastServerApp = app.add_subcommand("broadcast_server", "Broadcasting server");
|
||||
@ -336,8 +337,12 @@ int main(int argc, char** argv)
|
||||
addTLSOptions(proxyServerApp);
|
||||
|
||||
CLI::App* minidumpApp = app.add_subcommand("upload_minidump", "Upload a minidump to sentry");
|
||||
minidumpApp->add_option("--minidump", minidump, "Minidump path")->required()->check(CLI::ExistingPath);
|
||||
minidumpApp->add_option("--metadata", metadata, "Metadata path")->required()->check(CLI::ExistingPath);
|
||||
minidumpApp->add_option("--minidump", minidump, "Minidump path")
|
||||
->required()
|
||||
->check(CLI::ExistingPath);
|
||||
minidumpApp->add_option("--metadata", metadata, "Metadata path")
|
||||
->required()
|
||||
->check(CLI::ExistingPath);
|
||||
minidumpApp->add_option("--project", project, "Sentry Project")->required();
|
||||
minidumpApp->add_option("--key", key, "Sentry Key")->required();
|
||||
minidumpApp->add_flag("-v", verbose, "Verbose");
|
||||
@ -394,7 +399,8 @@ int main(int argc, char** argv)
|
||||
}
|
||||
else if (app.got_subcommand("echo_server"))
|
||||
{
|
||||
ret = ix::ws_echo_server_main(port, greetings, hostname, tlsOptions, ipv6);
|
||||
ret = ix::ws_echo_server_main(
|
||||
port, greetings, hostname, tlsOptions, ipv6, disablePerMessageDeflate);
|
||||
}
|
||||
else if (app.got_subcommand("broadcast_server"))
|
||||
{
|
||||
|
3
ws/ws.h
3
ws/ws.h
@ -30,7 +30,8 @@ namespace ix
|
||||
bool greetings,
|
||||
const std::string& hostname,
|
||||
const ix::SocketTLSOptions& tlsOptions,
|
||||
bool ipv6);
|
||||
bool ipv6,
|
||||
bool disablePerMessageDeflate);
|
||||
|
||||
int ws_broadcast_server_main(int port,
|
||||
const std::string& hostname,
|
||||
|
@ -5,10 +5,10 @@
|
||||
*/
|
||||
|
||||
#include <atomic>
|
||||
#include <ixwebsocket/IXDNSLookup.h>
|
||||
#include <ixwebsocket/IXNetSystem.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <sstream>
|
||||
#include <ixwebsocket/IXNetSystem.h>
|
||||
#include <ixwebsocket/IXDNSLookup.h>
|
||||
|
||||
|
||||
namespace ix
|
||||
|
@ -4,8 +4,8 @@
|
||||
* Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <ixwebsocket/IXWebSocketServer.h>
|
||||
#include <ixwebsocket/IXNetSystem.h>
|
||||
#include <ixwebsocket/IXWebSocketServer.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <sstream>
|
||||
|
||||
@ -15,7 +15,8 @@ namespace ix
|
||||
bool greetings,
|
||||
const std::string& hostname,
|
||||
const ix::SocketTLSOptions& tlsOptions,
|
||||
bool ipv6)
|
||||
bool ipv6,
|
||||
bool disablePerMessageDeflate)
|
||||
{
|
||||
spdlog::info("Listening on {}:{}", hostname, port);
|
||||
|
||||
@ -28,6 +29,12 @@ namespace ix
|
||||
|
||||
server.setTLSOptions(tlsOptions);
|
||||
|
||||
if (disablePerMessageDeflate)
|
||||
{
|
||||
spdlog::info("Disable per message deflate");
|
||||
server.disablePerMessageDeflate();
|
||||
}
|
||||
|
||||
server.setOnConnectionCallback(
|
||||
[greetings](std::shared_ptr<ix::WebSocket> webSocket,
|
||||
std::shared_ptr<ConnectionState> connectionState) {
|
||||
|
Reference in New Issue
Block a user