static unsigned int opts;
static int was_closed;
+static int deny_deflate;
/*
* This demo shows how to connect multiple websockets simultaneously to a
fprintf(stderr, "rx %d '%s'\n", (int)len, (char *)in);
break;
+ /* because we are protocols[0] ... */
+
+ case LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED:
+ if (strcmp(in, "deflate-stream") == 0)
+ if (deny_deflate) {
+ fprintf(stderr, "denied deflate-stream extension\n");
+ return 1;
+ }
+ break;
+
default:
break;
}
{ "ssl", no_argument, NULL, 's' },
{ "killmask", no_argument, NULL, 'k' },
{ "version", required_argument, NULL, 'v' },
+ { "undeflated", no_argument, NULL, 'u' },
{ NULL, 0, 0, 0 }
};
goto usage;
while (n >= 0) {
- n = getopt_long(argc, argv, "v:khsp:", options, NULL);
+ n = getopt_long(argc, argv, "uv:khsp:", options, NULL);
if (n < 0)
continue;
switch (n) {
case 'v':
ietf_version = atoi(optarg);
break;
+ case 'u':
+ deny_deflate = 1;
+ break;
case 'h':
goto usage;
}