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

473 commits

Author SHA1 Message Date
Andy Green
4393edf1a5 esp-idf-update 2024-11-03 07:59:12 +00:00
Andy Green
0fbe31e00b spi: read 2024-11-03 07:59:12 +00:00
Orgad Shaneh
4c3f13eda0 win: change uid_t and gid_t from int to unsigned int
Like they are on Linux.
2024-10-03 05:24:54 +01:00
Andy Green
5f3d5e3a3d custom_event: fake_POLLIN_override
As discussed in

https://github.com/warmcat/libwebsockets/issues/3219
2024-09-30 12:49:08 +01:00
Andy Green
9dbbd45170 lws_get_urlarg_by_name: drop candidates that wont fit in buf rather than bail
https://github.com/warmcat/libwebsockets/issues/3227
2024-09-28 06:03:06 +01:00
Andy Green
8d27d941c3 check func munging
https://github.com/warmcat/libwebsockets/issues/3181
2024-09-25 09:45:49 +01:00
Andy Green
38677d36e5 lws_extension_callback_pm_deflate: make visible
https://github.com/warmcat/libwebsockets/issues/3178
2024-09-25 07:45:38 +01:00
c-jimenez
c57c239368 basic-auth: allow NUL in password
https://github.com/warmcat/libwebsockets/issues/3092
2024-03-11 07:54:39 +00:00
Patrick Johnston
a8cb52408d genaes: fix lws_genaes_create comment 2024-03-06 13:09:17 +00:00
Liu Dongmiao
fe9a2b86ab ws: allow reserved bits and opcode
should close #3076
2024-03-01 08:15:08 +00:00
Andy Green
378ad62adf digest: only if we have tls lib to do hashing 2024-02-16 15:45:45 +00:00
Andy Green
49bfef2ecd wol: portability
https://github.com/warmcat/libwebsockets/issues/3048
2024-01-13 08:53:55 +00:00
Andy Green
3207da067e vhost: allow fd adoption 2024-01-04 11:35:01 +00:00
stropee
a33770ab87 tokenize: max token length to 256 2023-12-27 06:34:08 +00:00
Andy Green
52a6ab357e context info: add default_loglevel
Allow this kind of pattern for context creation info preparation

        struct lws_context_creation_info info;

        lws_context_info_defaults(&info, policy);
        info.default_loglevel = LLL_USER | LLL_ERR | LLL_WARN;
        lws_cmdline_option_handle_builtin(argc, argv, &info);

Calling lws_context_info_defaults() zeros down and prepares boilerplate in
the info struct, setting the default_loglevel asserts your application
default for the loglevel and then lws_cmdline_option_handle_builtin() will
set either that default loglevel, or override it from the commandline with
-d 1039 etc
2023-12-14 05:53:21 +00:00
Andy Green
957503436e http: mounts: LWSMPRO_NO_MOUNT
Provide a way to apply exception mount urls that exist on top of a larger
mount, but provide an exception which enforces the url to not be serviced
by the mount code, but by whatever dynamic handler is in place.
2023-12-12 05:57:38 +00:00
Andy Green
5e43b7039c ss: server: adopt 2023-12-10 09:18:52 +00:00
Andy Green
44d9bc08f5 ss: lws_ss_get_vhost 2023-12-09 07:59:04 +00:00
Ilya Smelykh
fdfde2ce0b http: auth digest 2023-12-08 10:25:50 +00:00
Andy Green
dab8e1c4f8 mac length: switch to ETHER_ADDR_LEN
Long story, there's also minimal example to take care of.

This change should take care of anything with ETHER_ADDR_LEN in
net/ethernet.h plus windows, for both the lib and example.
2023-12-07 05:31:25 +00:00
Andy Green
4af988600f net: lws_wol() and lws_parse_mac()
Introduce a LWS_WITH_WOL and an api to wake a mac address, optionally with
an address bind to the local interface to go out on.

Add a helper to parse ascii mac addresses well, and add tests.

Also thanks to OgreTransporter
https://github.com/warmcat/libwebsockets/issues/3016
2023-11-24 05:44:42 +00:00
Italo Sampaio
1097abc68e docs: set port to zero when using unix domain sockets
When a server is set to listen to a unix domain socket, i.e. options
field of struct lws_context_creation_info has the
LWS_SERVER_OPTION_UNIX_SOCK flag set, the port must be set do zero,
otherwise the unix socket is never created.
2023-11-23 09:45:12 +00:00
Rob Peters
6c2fdc1ac6 Correcting wrong function name in header file 2023-11-23 09:45:12 +00:00
Andy Green
48e09ddf51 clean: pedantic: remove repeated typedefs
https://github.com/warmcat/libwebsockets/issues/3002
2023-11-08 07:27:18 +00:00
Dylan Taft
18fdb0d6ec ipv6: Add support for RFC5014 for Linux
Linux has a sockopt flag defined by RFC5014 that informs IPv6 systems with
SLAAC config to prefer to bind the socket to a public address instead of
any temporary private address.

This patch adds a client info flag LCCSCF_IPV6_PREFER_PUBLIC_ADDR that lets
the user indicate the client socket should be prepared with the public
address binding preference.

Currently it's only implemented on Linux.
2023-10-15 07:54:50 +01:00
wangyingdong
07778789f4 Introducing libwebsockets support for nuttx
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2023-09-21 13:08:16 +01:00
Andy Green
e8eb7d6bd6 dlo: add render_to_rgba 2023-02-10 06:03:43 +00:00
Andy Green
34ef70ab00 docs: compressed remaining_pack_payload case
https://github.com/warmcat/libwebsockets/issues/2683
2022-09-18 08:29:16 +01:00
Dmitry Potapov
bfbd80967a openssl3: change deprecated warnings suppression 2022-09-18 08:17:25 +01:00
Vladimir
8ab44ae28b client: win32: sul for client connection status polling
https://github.com/warmcat/libwebsockets/pull/2715
https://github.com/warmcat/libwebsockets/pull/2722
2022-09-18 06:16:14 +01:00
Damian Hobson-Garcia
a5ea6eabca remove LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY callback
When a certificate for a TLS connection is provided, but a private
key is not, the SSL_CTX initialization exits early, before the
CONTEXT_REQUIRES_PRIVATE_KEY callback can be issued.
Remove the now obsolete callback and update the vhost
field description to state that the LOAD_EXTRA_SERVER_VERIFY_CERTS
callback should be used instead.
2022-09-18 06:13:47 +01:00
Andy Green
19d9869af6 lejp: increase default complexity limits 2022-06-14 07:36:57 +01:00
Andy Green
4a443c3e2e lhp: add DLO layout support
Add a dlo-based layout callback for use with lhp.

If lhp_dl_render() is used as the Lws Html/CSS parser callback, it
produces a display_list representation of the Html as DLOs, referencing the
appropriate CSS to drive the layout as best it can.

The display list can be rasterized on to an lws_display using the display's
state object

  lds->disp->blit(lds, (uint8_t *)&dl, &box);
2022-05-04 08:43:26 +01:00
Andy Green
3063fe84aa http: lws_http_rel_to_url
URL-level relative-to-absolute converter given a base url
2022-05-04 08:43:26 +01:00
Andy Green
63d2f844db lhp: Lightweight HTML Parser
Introduce a very lightweight html5 + css2.1+ stateful stream parser, along
the same lines as the lws json and cbor ones.

This is interesting primarily because of just how low-resource it is for
modest css + html, it uses an lwsac to hold the entirity of the css in
memory at once but the html is parsed in chunks without any need to keep
previous chunks around (chunks may be as small as 1 byte).

A user callback receives element entry and exit callbacks with payload and
all attributes parsed out, CSS related to the active element stack is
parsed to provide a list of active css attributes, which takes heap for the
duration of the parsing.

In effect this provides rich information about the html and css state to
the callback, which has the job of producing the layout in a user-defined
way.

As such, there is no DOM in memory at one time, there is only a stack of
active elements like <html><body><div>xxx with their associated attributes
(like class).  So as it is, it does not support DOM modification such as
JS changing elements after parsing, although elements with interesting IDs
could be kept around by the callback.  There is a corresponding tiny and
relatively flat heap usage regardless of html size.

Default CSS is specified as recommended in the CSS 2.1 standard.

Inline <style></style> elements are supported, but not pre-html5 style= in
element attributes, since these are incompatible with strict CSP.

What the attributes should mean on your system, eg, font-size, font-family
etc is left for the user callback to decide, along with how to lay out the
items using the CSS attributes, and render them.

Fixed point 32.32 constants are used (fraction expressed at parts in 100M)
instead of floating point.

If you have presentation needs, even on a constrained display on a
constrained microcontroller, this makes it feasible to use standardized
markup and styling instead of roll your own.
2022-05-04 08:43:26 +01:00
Chunho Lee
93d66b8301 ss: mqtt: add support for AWS IoT Shadow topic
This introduces AWS IoT Shadow topic support. This subscribes and
unsubscribes shadow response topics before and after shadow topic
is transmitted.
2022-05-04 08:42:43 +01:00
Per Bothner
93aaaf371c docs: fix typo 2022-04-10 09:56:27 +01:00
Andy Green
f5ae2bc657 clean: remove public apis for removed functions
https://github.com/warmcat/libwebsockets/issues/2605
2022-04-10 06:56:12 +01:00
Andy Green
047fb7bb21 tokenize: enhance to support chunked parsing
Add EXPECT_MORE flag to indicate that running out of input is not (yet)
indicating the end of the document.  The caller should remove this flag
when it identifies that it does not have the chunk with the end of the
document: the last chunk may be zero length.

Track line numbers so the caller can infer CR, absorb CRLF -> CR.

Also add COLON_NONTERM needed for ipv6 literal addresses.
2022-04-10 06:56:12 +01:00
Andy Green
a54480ba93 lws_display: SSD1675B 2022-04-10 06:56:12 +01:00
Andy Green
c7ebe639be lws-display: UC8176 EPD driver 2022-04-10 06:56:02 +01:00
Andy Green
9b47b768f4 lws_display: SPD1656 driver
Add SPD1656 SPI driver as used in 5.65 inch 7-colour waveshare panel.
2022-03-25 08:18:30 +00:00
Andy Green
d6c4e606e7 ssd1306: adapt blit for DMA 2022-03-25 08:18:30 +00:00
Andy Green
019da2e539 ili9341: adapt blit for DMA
This is the SPI client chip in the LCD displays on ESP32 WROVER-KIT and S2
Kaluga.

Adapt it to allocate using DMA-able allocators and to use the new blit op
conventions for update sequencing
2022-03-25 08:18:30 +00:00
Andy Green
e3743d47b4 lws_spi: Add esp32 DMA support
This provides an alternative esp32-specific SPI driver with ops that can be
swapped in place of the gpio bitbang one.

The pinmux info and lws gpio driver and other data in the spi bitbang
struct are used as-is by the DMA one.

New ops are provided which are able to allocate and free DMA-able memory so
the device drivers can prepare directly usable buffers.  Bounce through to
DMA-able buffers is also transparently supported.
2022-03-25 08:18:30 +00:00
Andy Green
fcbc0dafa4 lws_ota 2022-03-25 08:18:30 +00:00
Andy Green
24fdd1f225 base64: improve sanity checking
Improve rejection of invalid chars
2022-03-25 08:18:30 +00:00
Andy Green
6a65d76779 hex-to-bin: api with input length 2022-03-25 08:18:29 +00:00
Andy Green
c11e31547f ss: introduce sinks 2022-03-25 08:18:29 +00:00
Andy Green
a3a4253ba9 dlo: lws_dlo_fops file_ops
This adds an optional lws VFS layer that exposes the named dlo object
registry.  So you can register a blob like a JPG named "my.jpg", and
access it on the vfs as, eg,  /dlofs/my.jpg (or file:///dlofs/my.jpg
if using the SS file:// support for VFS namespace).
2022-03-25 08:18:29 +00:00