- /* create a client websocket using dumb increment protocol */
-
- wsi_dumb = libwebsocket_client_connect(context, address, port, use_ssl,
- "/", "http://host", "origin",
- protocols[PROTOCOL_DUMB_INCREMENT].name);
-
- if (wsi_dumb == NULL) {
- fprintf(stderr, "libwebsocket dumb connect failed\n");
- return -1;
- }
-
- /* create a client websocket using mirror protocol */
-
- wsi_mirror = libwebsocket_client_connect(context, address, port,
- use_ssl, "/", "http://host", "origin",
- protocols[PROTOCOL_LWS_MIRROR].name);
-
- if (wsi_mirror == NULL) {
- fprintf(stderr, "libwebsocket dumb connect failed\n");
- return -1;
- }
-
- fprintf(stderr, "Websocket connections opened\n");
+ if (!strcmp(prot, "http") || !strcmp(prot, "https")) {
+ lwsl_notice("using %s mode (non-ws)\n", prot);
+ i.method = "GET";
+ do_ws = 0;
+ } else
+ lwsl_notice("using %s mode (ws)\n", prot);