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

472 commits

Author SHA1 Message Date
Andy Green
75849aa83b minimal-ss-binance-update-path 2025-02-14 17:53:50 +00:00
Andy Green
19d2e9d828 minimal-ss-binance-update-CA 2025-02-14 16:10:00 +00:00
Andy Green
a74362ffdd examples: ss server: correct README 2024-12-18 07:24:07 +00:00
Andy Green
626f8816cf esp-idf: update compatibility to 5.3.1 2024-11-03 07:59:12 +00:00
Andy Green
4393edf1a5 esp-idf-update 2024-11-03 07:59:12 +00:00
Andy Green
41eed87c79 cmake: upgrade everyone to 3.5 minimum version 2023-12-08 13:23:04 +00:00
songbuhuang
237506fed1 delete_from_fd: assert if fd beyond the max_fds
Signed-off-by: songbuhuang <544824346@qq.com>
2022-09-18 08:17:25 +01:00
Andy Green
31ff36e09d minimal: embedded lhp examples
Implements a carousel rendering and displaying remote HTML + JPEG + PNGs
on a variety of display devices, including several EPDs.
2022-05-04 08:43:26 +01:00
Andy Green
5f749bb796 ss: add get_metadata example 2022-04-29 10:47:59 +01:00
Andy Green
c11e31547f ss: introduce sinks 2022-03-25 08:18:29 +00:00
Andy Green
aa696773f0 lws_display: improve apis to use display_state and frac
Adapt disp ops to use lws_display_state_t instead of the const disp object.

Describe display area in pixels and mm using lws_fixed3232.
2022-03-25 08:13:48 +00:00
Andy Green
bad7a28bfd esp32: heltec: change delay
Newer esp-idf has lost ets-delay-us
2022-03-15 10:28:09 +00:00
Andy Green
9b92c47101 ss: reject direct protocol metadata if NULL ss wsi
The ss wsi may be NULL after any time around the event loop.  Make sure we
check that before we start trying to use it.
2022-02-22 14:37:31 +00:00
Andy Green
dd1e07b28a ss: hello_world uses default policy
This switches the current hello_world to be hello_world-policy now,
and hello_world is simplified to use the __default policy without any
explicit policy of its own.

Using the default policy means it relies on the system tls library to
validate the tls connections using system trust arrangements, that won't
work in cases where the configured tls library does not have its own trust
store.
2022-02-22 14:37:10 +00:00
Andy Green
53d195022f cmake: Enable WITH_MINIMAL_EXAMPLES by default
Although many of the examples must be run from the example directory as
cwd, everyone getting started probably wants to try the examples, cmake
knows how to do it, so let's enable it by default.
2021-11-11 11:52:46 +00:00
Andy Green
c1e6906fc8 minimal: client: hello_world: polish a bit more
This is the ur-template for the new examples, try to make it as good an
exemplar as possible
2021-10-29 15:41:52 +01:00
Andy Green
310e576cdc esp32-c3dev: remove stray ssd1306 copy 2021-10-29 15:41:52 +01:00
Andy Green
2ce2447397 minimal: ss: handle usleep in win32
AG: also take care of additional requirements for tests that need h2
2021-10-28 16:50:28 +01:00
Andy Green
67f532a8c6 cmake: bring tls include requirement out as PUBLIC
There's no problem for library build, also with LWS_WITH_MINIMAL_EXAMPLES,
but after install at least on OSX, there are problems finding the installed
lws include dir (concealed on most platforms by the path being in the
default search list for the toolchain), and the references in the lws
includes to the tls includes meaning that explicit paths for that must be
available at consuming cmakes.

This patch enhances the cmake config installed by lws to deal with adding
the lws include paths to CMAKE_REQUIRED_INCLUDES and include_directories,
so it can be found before the target is introduced.

The tls include is passed back up the CMakeLists layers and the lws targets
marked with target_include_directories(PUBLIC) with them, so they are
understood as needed by consumers.

More boilerplate is moved out of the example consuming cmakes.

After this, on machines with previous installs of older lws, you may have to
clean out the cmake install path, that is usually something like

/usr/local/lib/cmake/libwebsockets/*

before make installing lws and putting the latest content in there.
2021-10-28 08:12:48 +01:00
Andy Green
2761badd0f minimal: ss: embedded: RT595S ACM transport
Adds an example for NXP RT595S eval board, using serialized SS over CDC /
ACM USB composite device, one ttyACM for logs and the other for the SSS
link.
2021-10-24 16:50:39 +01:00
Andy Green
83b0221ba8 minimal: esp32: wrover display: increase smd timeout to cover delays in display 2021-10-09 07:36:39 +01:00
Andy Green
51e4cc8258 ss: mass update LE root to ISRG X1 2021-10-08 09:49:06 +01:00
Andy Green
8fd1ea6180 examples: move existing to m-e-lowlevel and start repoulating m-e with SS 2021-10-08 09:49:05 +01:00
Andy Green
2cfa260e62 sspc: refactor to allow different transports
This is a NOP for existing usecases.

At the moment the only implemented transport for serialized SS is wsi, it's
typically used with Unix Domain Sockets, but it also works over tcp the
same.

It generalizes the interface between serialized chunks and the
transport, separately for client and proxy.  The wsi transport is migrated
to use the new transport ops structs.

It will then be possible to "bring your own transport", so long as it is
reliable, and in-order, both for proxy and client / sspc.

We also adapt minimal-secure-streams-binance to build the -client variant
via SS proxy as well.

LWS_ONLY_SSPC is added so libwebsockets can be produced with just sspc
client support even for tiny targets.

A new embedded minimal example for rpi pico is also provided that
demonstrates using Serialized SS over a UART to an SS proxy, to implement
the SS Binance example on the pico, even though it has no networking itself.
2021-10-08 09:48:41 +01:00
Andy Green
43bb8aead0 dsh: coalesce 2021-10-08 09:48:41 +01:00
Pavel Otchertsov
d18aa1ee0b examples: fix sizeof lws_tls_cert_info_results in test_jwt_RS256 2021-10-05 07:40:17 +01:00
Andy Green
ee15b82b6e cmake: unbreak LWS_WITH_SYS_STATE disabled build 2021-10-05 07:40:17 +01:00
Andy Green
19ba1998fa tls: evolve handshake serialization into simultaneous_ssl_handshake_restriction
This patch adapts the recent change about serializing the number of
simultaneous tls handshakes allowed to 1, so you can set the number in the
context creation info, and the accounting for it is handled by counters
same as the overally tls restriction.

The name of the context info var to control it changes to simultaneous_ssl_handshake_restriction
which is now a count, the default 0 means no limit.

The count rejects tls connection attempts when the tls borrow is attempted,
and separately hands back the hs borrow from the tls borrow when the
connection attempt fails or succeeds.
2021-10-05 07:40:17 +01:00
Andy Green
0fda90c40a ws-server-threads-smp: modernize 2021-10-05 07:40:03 +01:00
Andy Green
b6004e08c9 mqtt: allow indicating client_id is not on heap
Not sure why we don't leave any freeing to the caller, but since we don't
allow indicating that the provided client id should not be freed.
2021-10-05 07:09:47 +01:00
Andy Green
733f0c10f0 mbedtls: fix validation
mbedtls validation was broken by an earlier patch on main... fix it and add
a CI test also using the wrong CA cert so this can be caught straight away
from now on.
2021-10-05 07:09:13 +01:00
Andy Green
3e54c84a18 ss: mass update LE root to isrg part 2 2021-10-05 06:48:03 +01:00
Andy Green
c38567960a dsh: remove foreign support
We're going to refactor dsh to not have foreign support, let's remove it in
one step.
2021-10-04 12:59:27 +01:00
Andy Green
d075d4f9ca ctest: increase timeouts on tests using warmcat 2021-09-09 15:27:41 +01:00
Andy Green
a8a443e645 wolfssl: update gencrypto 2021-09-08 09:42:11 +01:00
Andy Green
06e881aad6 esp32c3
Add
2021-08-31 05:45:40 +01:00
Andy Green
81a3ca3e84 ss: port binance example 2021-08-31 05:45:40 +01:00
Andy Green
4db2ff872b cose: keys and signing + validation
Support for COSE keys and signing / validation

 - lws_cose_key_t and import / export / generation apis for EC / RSA / SYMMETRIC

 - cose_sign1 ES256/384/512,RS256/384/512 sign + validate, passes RFC8152 WG tests sign1-tests
 - cose_sign  ES256/384/512,RS256/384/512 sign + validate, passes RFC8152 WG tests sign-tests
 - cose_mac0  HS256/HS256_64/384/512      sign + validate, passes RFC8152 WG tests hmac-examples
 - cose_mac   HS256/HS256_64/384/512             validate, passes RFC8152 WG tests hmac-examples

 - lws-crypto-cose-key commandline tool for key / key set dumping and
   creation
 - lws-crypro-cose-sign commandline tool for signing / validation

 - lws-api-test-cose - large number of test vectors and tests from RFC8152
2021-08-31 05:45:35 +01:00
Andy Green
dcaa0013b4 lecp: add CBOR stream parser LECP like JSON LEJP
This provides very memory-efficient CBOR stream parsing
and writing.

The parser  converts pieces of CBOR into callbacks that define
the structure and collate string and blobs into buffer chunks
for extensible and easy access.

It is fragementation-safe and does not need all the CBOR in
the same place at one time, chunks of CBOR are parsed and
discarded as provided.

It does not allocate and just needs a few hundred bytes of
stack for even huge CBOR objects.  Huge strings and blobs
are handled without needing memory to hold them atomically.

Includes ./minimal-examples/api-tests/api-test-lecp that
unit tests it against 82 official example CBORs and
26 additional test vectors from COSE (just checking the CBOR
parsing).

The writing apis allow printf style semantics with a variety
of CBOR-aware %-formats.  The apis write into a context that
manages output buffer usage, if the output buffer fills,
then the apis return with an AGAIN code that lets you issue
and reset the output buffer and repeat the api all to issue
more output.  The subsequent calls can occur much later or
from a different function context, so this is perfect for
WRITEABLE-mediated output from the network parts of lws.

See ./READMEs/README.cbor-lecp.md
2021-08-21 17:44:40 +01:00
Yichen Gu
b31c5d6ffe http: cookies: support cookie jar in and out 2021-08-21 17:44:40 +01:00
Andy Green
b67d192100 lws_map 2021-08-21 17:44:40 +01:00
Andy Green
f6911cdab8 minimal: perf: add --test404[red] switches
--test404 sends us instead to httpbin.org/status/404
 --test404red goes to warmcat.com/noexist.html which is handled as a
              redirect to a 404 page (served with a 200...), streamtype
              allows redirects to be followed
 --test404redref same as above but streamtype disallows redirect follow

These should all produce CONMON results for the first response, be it 404
or 302 and whether the 302 was followed or not, and whether the client
goes via the proxy or not.
2021-08-19 10:02:16 +01:00
Andy Green
31bbeb520d minimal: eventlib-custom: handle fds removal in service
https://github.com/warmcat/libwebsockets/issues/2388
2021-08-19 05:31:15 +01:00
Andy Green
708903cb47 minimal: eventlib: custom: add client demonstration 2021-08-19 05:31:15 +01:00
Zhao Lou
2951a92ed8 conmon: fix missing quote in JSON 2021-08-19 05:28:27 +01:00
Andy Green
243c21deac ss: add fault injections in creation
Add 9 fault injection cases in SS creation flow, and 5 of those
instantiate in the minimal examples ctests.  The other 4 relate
to static policy and server, I tested the server ones by hand.

These tests confirm the recent change to unpick create using
lws_ss_destroy.
2021-08-16 08:07:35 +01:00
Andy Green
e644bb4a6e cpd: pass up lws_ss_request_tx ret 2021-08-16 08:07:32 +01:00
Andy Green
f3d5b9b99a service: assert on thread shenanigans 2021-08-13 05:25:01 +01:00
Jed Lu
62b915c879 ss: increase set_metadata length type to size_t 2021-08-09 17:31:16 +01:00
Andy Green
fac7c5bf9c seq: fix 2021-07-23 04:22:15 +01:00