Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1753412969, "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": "dffe96446a9bb49d89712a95ae545a5b01b835e7", "alias": []},"tree": [ { "name": "CMakeLists.txt","mode": "33188", "size":1179}, { "name": "README.md","mode": "33188", "size":3781}, { "name": "minimal-http-client.c","mode": "33188", "size":8134}, { "name": "warmcat.com.cer","mode": "33188", "size":1202}],"s":{"c":1753412969,"u": 569}} ,{"schema":"libjg2-1", "cid":"0ddb2f8efacc56395e5892c45a45a4eb", "oid":{ "oid": "dffe96446a9bb49d89712a95ae545a5b01b835e7", "alias": []},"blobname": "minimal-examples/http-client/minimal-http-client/README.md", "blob": "# lws minimal http client\n\nThe application goes to either https://warmcat.com or\nhttps://localhost:7681 (with `-l` option) and receives the page data.\n\n## build\n\n```\n $ cmake . \u0026\u0026 make\n```\n\n## usage\n\nCommandline option|Meaning\n---|---\n-d \u003cloglevel\u003e|Debug verbosity in decimal, eg, -d15\n-l| Connect to https://localhost:7681 and accept selfsigned cert\n--h1|Specify http/1.1 only using ALPN, rejects h2 even if server supports it\n--server \u003cname\u003e|set server name to connect to\n-k|Apply tls option LCCSCF_ALLOW_INSECURE\n-j|Apply tls option LCCSCF_ALLOW_SELFSIGNED\n-m|Apply tls option LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK\n-e|Apply tls option LCCSCF_ALLOW_EXPIRED\n-v|Connection validity use 3s / 10s instead of default 5m / 5m10s\n--nossl| disable ssl connection\n--user \u003cusername\u003e| Set Basic Auth username\n--password \u003cpassword\u003e | Set Basic Auth password\n\n```\n $ ./lws-minimal-http-client\n[2018/03/04 14:43:20:8562] USER: LWS minimal http client\n[2018/03/04 14:43:20:8571] NOTICE: Creating Vhost 'default' port -1, 1 protocols, IPv6 on\n[2018/03/04 14:43:20:8616] NOTICE: created client ssl context for default\n[2018/03/04 14:43:20:8617] NOTICE: lws_client_connect_2: 0x1814dc0: address warmcat.com\n[2018/03/04 14:43:21:1496] NOTICE: lws_client_connect_2: 0x1814dc0: address warmcat.com\n[2018/03/04 14:43:22:0154] NOTICE: lws_client_interpret_server_handshake: incoming content length 26520\n[2018/03/04 14:43:22:0154] NOTICE: lws_client_interpret_server_handshake: client connection up\n[2018/03/04 14:43:22:0169] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0169] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0169] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0169] USER: RECEIVE_CLIENT_HTTP_READ: read 1015\n[2018/03/04 14:43:22:0174] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0174] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0174] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0174] USER: RECEIVE_CLIENT_HTTP_READ: read 1015\n[2018/03/04 14:43:22:0179] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0179] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0179] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:0179] USER: RECEIVE_CLIENT_HTTP_READ: read 1015\n[2018/03/04 14:43:22:3010] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3010] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3010] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3010] USER: RECEIVE_CLIENT_HTTP_READ: read 1015\n[2018/03/04 14:43:22:3015] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3015] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3015] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3015] USER: RECEIVE_CLIENT_HTTP_READ: read 1015\n[2018/03/04 14:43:22:3020] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3020] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3020] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3020] USER: RECEIVE_CLIENT_HTTP_READ: read 1015\n[2018/03/04 14:43:22:3022] USER: RECEIVE_CLIENT_HTTP_READ: read 1024\n[2018/03/04 14:43:22:3022] USER: RECEIVE_CLIENT_HTTP_READ: read 974\n[2018/03/04 14:43:22:3022] NOTICE: lws_http_client_read: transaction completed says -1\n[2018/03/04 14:43:23:3042] USER: Completed\n```\n\nYou can also test the client Basic Auth support against the http-server/minimal-http-server-basicauth\nexample. In one console window run the server and in the other\n\n```\n$ lws-minimal-http-client -l --nossl --path /secret/index.html --user user --password password\n```\n\nThe Basic Auth credentials for the test server are literally username \u0022user\u0022 and password \u0022password\u0022.\n\n","s":{"c":1753412969,"u": 157}} ],"g": 2927,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 1, "si": 0, "db":0, "di":1, "sat":0, "lfc": "0000"}