Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1750143152, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ { "schema":"libjg2-1", "oid":{ "oid": "f71b6035c8aea4e2ad57782b70fc9d2cc9e2e3f4", "alias": []},"tree": [ { "name": "CMakeLists.txt","mode": "33188", "size":746}, { "name": "README.md","mode": "33188", "size":7644}, { "name": "libwebsockets.org.cer","mode": "33188", "size":3562}, { "name": "minimal-ws-client-ping.c","mode": "33188", "size":3980}],"s":{"c":1750143152,"u": 463}} ,{"schema":"libjg2-1", "cid":"2ae927d730ad82aada09285d07e75319", "oid":{ "oid": "f71b6035c8aea4e2ad57782b70fc9d2cc9e2e3f4", "alias": []},"blobname": "minimal-examples/ws-client/minimal-ws-client-ping/README.md", "blob": "# lws minimal ws client PING\n\nThis connects to libwebsockets.org using the lws-mirror-protocol.\n\nIt sets a validity regime of testing validity with PING every 3s and failing\nif it didn't get the PONG back within 10s.\n\n## build\n\n```\n $ cmake . \u0026\u0026 make\n```\n\n## Commandline Options\n\nOption|Meaning\n---|---\n-d|Set logging verbosity (you want 1039 to see the validity ping / pong)\n--server|Use a specific server instead of libwebsockets.org, eg `--server localhost`. Implies LCCSCF_ALLOW_SELFSIGNED\n--port|Use a specific port instead of 443, eg `--port 7681`\n--protocol|Use a specific ws subprotocol rather than lws-mirror-protocol, eg, `--protocol myprotocol`\n\n\n## usage\n\nJust run it, wait for the connect and then there will be PINGs sent\nat 5s intervals.\n\n```\n $ ./lws-minimal-ws-client-ping -d1039\n[2020/03/18 13:13:47:1114] U: LWS minimal ws client PING\n[2020/03/18 13:13:47:1503] I: Initial logging level 1039\n[2020/03/18 13:13:47:1507] I: Libwebsockets version: 4.0.99 v4.0.0-20-gc6165f868\n[2020/03/18 13:13:47:1508] I: IPV6 not compiled in\n[2020/03/18 13:13:47:1512] I: LWS_DEF_HEADER_LEN : 4096\n[2020/03/18 13:13:47:1514] I: LWS_MAX_SMP : 1\n[2020/03/18 13:13:47:1519] I: sizeof (*info) : 720\n[2020/03/18 13:13:47:1520] I: SYSTEM_RANDOM_FILEPATH: '/dev/urandom'\n[2020/03/18 13:13:47:1522] I: HTTP2 support : available\n[2020/03/18 13:13:47:1552] N: lws_create_context: using ss proxy bind '(null)', port 0, ads '(null)'\n[2020/03/18 13:13:47:1557] I: context created\n[2020/03/18 13:13:47:1575] I: Using event loop: poll\n[2020/03/18 13:13:47:1583] I: Default ALPN advertisment: h2,http/1.1\n[2020/03/18 13:13:47:1585] I: default timeout (secs): 20\n[2020/03/18 13:13:47:1614] I: Threads: 1 each 5 fds\n[2020/03/18 13:13:47:1623] I: mem: context: 8152 B (4056 ctx + (1 thr x 4096))\n[2020/03/18 13:13:47:1625] I: mem: http hdr size: (4096 + 976), max count 5\n[2020/03/18 13:13:47:1629] I: mem: pollfd map: 40 B\n[2020/03/18 13:13:47:1633] I: mem: platform fd map: 40 B\n[2020/03/18 13:13:47:1692] I: Compiled with OpenSSL support\n[2020/03/18 13:13:47:1695] I: Doing SSL library init\n[2020/03/18 13:13:47:3103] I: canonical_hostname \u003d constance\n[2020/03/18 13:13:47:3140] I: Creating Vhost 'default' (serving disabled), 4 protocols, IPv6 off\n[2020/03/18 13:13:47:4072] I: lws_tls_client_create_vhost_context: vh default: created new client ctx 0\n[2020/03/18 13:13:47:7468] I: created client ssl context for default\n[2020/03/18 13:13:47:7482] I: Creating Vhost 'default' (serving disabled), 4 protocols, IPv6 off\n[2020/03/18 13:13:47:7490] I: lws_tls_client_create_vhost_context: vh default: reusing client ctx 0: use 2\n[2020/03/18 13:13:47:7491] I: created client ssl context for default\n[2020/03/18 13:13:47:7494] I: mem: per-conn: 792 bytes + protocol rx buf\n[2020/03/18 13:13:47:7497] I: lws_plat_drop_app_privileges: not changing group\n[2020/03/18 13:13:47:7499] I: lws_plat_drop_app_privileges: not changing user\n[2020/03/18 13:13:47:7512] I: lws_cancel_service\n[2020/03/18 13:13:47:7568] I: lws_state_notify_protocol_init: LWS_SYSTATE_CPD_PRE_TIME\n[2020/03/18 13:13:47:7577] N: lws_ss_create: unknown stream type captive_portal_detect\n[2020/03/18 13:13:47:7580] I: lws_ss_sys_cpd: Create stream failed (policy?)\n[2020/03/18 13:13:47:7582] I: lws_state_notify_protocol_init: LWS_SYSTATE_CPD_PRE_TIME\n[2020/03/18 13:13:47:7582] N: lws_ss_create: unknown stream type captive_portal_detect\n[2020/03/18 13:13:47:7583] I: lws_ss_sys_cpd: Create stream failed (policy?)\n[2020/03/18 13:13:47:7585] I: lws_state_notify_protocol_init: doing protocol init on POLICY_VALID\n[2020/03/18 13:13:47:7588] I: lws_protocol_init\n[2020/03/18 13:13:47:7623] I: lws_state_transition_steps: CONTEXT_CREATED -\u003e OPERATIONAL\n[2020/03/18 13:13:47:7628] N: connect_cb: connecting\n[2020/03/18 13:13:47:7656] I: lws_client_connect_via_info: role binding to h1\n[2020/03/18 13:13:47:7662] I: lws_client_connect_via_info: protocol binding to lws-ping-test\n[2020/03/18 13:13:47:7699] I: lws_client_connect_via_info: wsi 0x5669090: h1 lws-ping-test entry\n[2020/03/18 13:13:47:7720] I: lws_header_table_attach: wsi 0x5669090: ah (nil) (tsi 0, count \u003d 0) in\n[2020/03/18 13:13:47:7729] I: _lws_create_ah: created ah 0x5669620 (size 4096): pool length 1\n[2020/03/18 13:13:47:7735] I: lws_header_table_attach: did attach wsi 0x5669090: ah 0x5669620: count 1 (on exit)\n[2020/03/18 13:13:47:7780] I: lws_client_connect_2_dnsreq: 0x5669090: lookup libwebsockets.org:443\n[2020/03/18 13:13:47:8784] I: lws_getaddrinfo46: getaddrinfo 'libwebsockets.org' says 0\n[2020/03/18 13:13:47:8804] I: lws_client_connect_3_connect: libwebsockets.org ipv4 46.105.127.147\n[2020/03/18 13:13:47:9176] I: lws_client_connect_3_connect: getsockopt check: conn OK\n[2020/03/18 13:13:47:9179] I: lws_client_connect_3_connect: Connection started 0x5682cc0\n[2020/03/18 13:13:47:9197] I: lws_client_connect_4_established: wsi 0x5669090: h1 lws-ping-test client created own conn (raw 0) vh defaultm st 0x202\n[2020/03/18 13:13:47:9418] I: h1 client conn using alpn list 'http/1.1'\n[2020/03/18 13:13:48:4523] I: lws_role_call_alpn_negotiated: 'http/1.1'\n[2020/03/18 13:13:48:4531] I: client connect OK\n[2020/03/18 13:13:48:4543] I: lws_openssl_describe_cipher: wsi 0x5669090: TLS_AES_256_GCM_SHA384, TLS_AES_256_GCM_SHA384, 256 bits, TLSv1.3\n[2020/03/18 13:13:48:4717] I: lws_client_socket_service: HANDSHAKE2: 0x5669090: sending headers (wsistate 0x10000204), w sock 5\n[2020/03/18 13:13:48:4992] I: lws_buflist_aware_read: wsi 0x5669090: lws_client_socket_service: ssl_capable_read -4\n[2020/03/18 13:13:48:5005] I: lws_buflist_aware_read: wsi 0x5669090: lws_client_socket_service: ssl_capable_read 174\n[2020/03/18 13:13:48:5166] I: __lws_header_table_detach: wsi 0x5669090: ah 0x5669620 (tsi\u003d0, count \u003d 1)\n[2020/03/18 13:13:48:5171] I: __lws_header_table_detach: nobody usable waiting\n[2020/03/18 13:13:48:5175] I: _lws_destroy_ah: freed ah 0x5669620 : pool length 0\n[2020/03/18 13:13:48:5180] I: __lws_header_table_detach: wsi 0x5669090: ah 0x5669620 (tsi\u003d0, count \u003d 0)\n[2020/03/18 13:13:48:5197] I: _lws_validity_confirmed_role: wsi 0x5669090: setting validity timer 3s (hup 0)\n[2020/03/18 13:13:48:5208] U: callback_minimal_broker: established\n[2020/03/18 13:13:51:5218] I: lws_validity_cb: wsi 0x5669090: scheduling validity check\n[2020/03/18 13:13:51:5325] I: rops_handle_POLLOUT_ws: issuing ping on wsi 0x5669090: ws lws-ping-test h2: 0\n[2020/03/18 13:13:51:5504] I: lws_issue_raw: ssl_capable_write (6) says 6\n[2020/03/18 13:13:51:5809] I: lws_ws_client_rx_sm: client 0x5669090 received pong\n[2020/03/18 13:13:51:5819] I: _lws_validity_confirmed_role: wsi 0x5669090: setting validity timer 3s (hup 0)\n[2020/03/18 13:13:51:5831] I: Client doing pong callback\n[2020/03/18 13:13:54:5821] I: lws_validity_cb: wsi 0x5669090: scheduling validity check\n[2020/03/18 13:13:54:5825] I: rops_handle_POLLOUT_ws: issuing ping on wsi 0x5669090: ws lws-ping-test h2: 0\n[2020/03/18 13:13:54:5833] I: lws_issue_raw: ssl_capable_write (6) says 6\n[2020/03/18 13:13:54:6258] I: lws_ws_client_rx_sm: client 0x5669090 received pong\n[2020/03/18 13:13:54:6261] I: _lws_validity_confirmed_role: wsi 0x5669090: setting validity timer 3s (hup 0)\n[2020/03/18 13:13:54:6263] I: Client doing pong callback\n[2020/03/18 13:13:57:6263] I: lws_validity_cb: wsi 0x5669090: scheduling validity check\n[2020/03/18 13:13:57:6267] I: rops_handle_POLLOUT_ws: issuing ping on wsi 0x5669090: ws lws-ping-test h2: 0\n[2020/03/18 13:13:57:6275] I: lws_issue_raw: ssl_capable_write (6) says 6\n[2020/03/18 13:13:58:0034] I: lws_ws_client_rx_sm: client 0x5669090 received pong\n\n...\n```\n\n","s":{"c":1750143152,"u": 262}} ],"g": 4186,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 1, "si": 0, "db":0, "di":1, "sat":0, "lfc": "0000"}