1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

minimal-ws-client-echo: add --ssl flag

This commit is contained in:
Andy Green 2018-11-03 09:10:57 +08:00
parent 27ae132e7b
commit da59453302
3 changed files with 6 additions and 0 deletions

View file

@ -19,6 +19,7 @@ Commandline option|Meaning
-p port|Port to connect to
-u url|URL path part to connect to
-o|Finish after one connection
--ssl|Open client connection with ssl
```
$ ./lws-minimal-ws-client-echo

View file

@ -113,6 +113,9 @@ int main(int argc, const char **argv)
if (lws_cmdline_option(argc, argv, "-o"))
options |= 1;
if (lws_cmdline_option(argc, argv, "--ssl"))
options |= 2;
if ((p = lws_cmdline_option(argc, argv, "-s")))
ads = p;

View file

@ -65,6 +65,8 @@ connect_client(struct vhd_minimal_client_echo *vhd)
i.host = host;
i.origin = host;
i.ssl_connection = 0;
if ((*vhd->options) & 2)
i.ssl_connection |= LCCSCF_USE_SSL;
i.vhost = vhd->vhost;
//i.protocol = ;
i.pwsi = &vhd->client_wsi;