diff --git a/droplet/playground/stress.html b/droplet/playground/stress.html index 98abaeb..10b581e 100644 --- a/droplet/playground/stress.html +++ b/droplet/playground/stress.html @@ -82,7 +82,7 @@ const randInt = (lower, upper) => Math.floor(Math.random() * (upper - lower) + lower); const randStr = (size) => { - const buffer = new Uint8Array(Math.random() * 100); + const buffer = new Uint8Array(Math.random() * 10000); for (let i = 0; i < buffer.length; i++) { buffer[i] = 48 + randInt(0, 9); } diff --git a/droplet/src/droplet.c b/droplet/src/droplet.c index b68b540..e5fff50 100644 --- a/droplet/src/droplet.c +++ b/droplet/src/droplet.c @@ -39,6 +39,15 @@ static const char* get_mount_origin(int argc, const char** argv) return "./playground"; } +#ifndef LWS_WITHOUT_EXTENSIONS +static const struct lws_extension extensions[] = { + { "permessage-deflate", + lws_extension_callback_pm_deflate, + "permessage-deflate" }, + { NULL, NULL, NULL /* terminator */ } +}; +#endif + int main(int argc, const char** argv) { signal(SIGINT, sigint_handler); @@ -46,7 +55,7 @@ int main(int argc, const char** argv) username_init(); #ifndef NDEBUG - lws_set_log_level(LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE, NULL); + lws_set_log_level(LLL_ERR | LLL_WARN | LLL_NOTICE, NULL); #else lws_set_log_level(LLL_ERR | LLL_WARN, NULL); #endif @@ -62,6 +71,10 @@ int main(int argc, const char** argv) info.mounts = &mount; info.protocols = protocols; +#ifndef LWS_WITHOUT_EXTENSIONS + info.extensions = extensions; +#endif + info.ka_time = 120; info.ka_probes = 30; info.ka_interval = 4;