All Projects → cloudflare → Lol Html

cloudflare / Lol Html

Licence: bsd-3-clause
Low output latency streaming HTML parser/rewriter with CSS selector-based API

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Lol Html

Jaxon
Streaming JSON parser for Elixir
Stars: ✭ 145 (-74.38%)
Mutual labels:  stream, parser, streaming
chromecast-api
📺 Chromecast Node.js module
Stars: ✭ 122 (-78.45%)
Mutual labels:  streaming, stream
wsa
WSA(Websocket Streaming Agent) is a stream server target for mp4/h264 streaming over websocket
Stars: ✭ 35 (-93.82%)
Mutual labels:  streaming, stream
Rtspallthethings
Deprecated RTSP media server -- Use github.com/aler9/rtsp-simple-server instead.
Stars: ✭ 258 (-54.42%)
Mutual labels:  stream, streaming
Ustreamer
µStreamer - Lightweight and fast MJPG-HTTP streamer
Stars: ✭ 533 (-5.83%)
Mutual labels:  stream, streaming
playercast
Cast to media player and control playback remotely.
Stars: ✭ 46 (-91.87%)
Mutual labels:  streaming, stream
Diffy
🎞️💓🍿 Love streaming - It's always best to watch a movie together ! 🤗
Stars: ✭ 37 (-93.46%)
Mutual labels:  streaming, stream
Azure Event Hubs
☁️ Cloud-scale telemetry ingestion from any stream of data with Azure Event Hubs
Stars: ✭ 233 (-58.83%)
Mutual labels:  stream, streaming
Multistreamer
[discontinued] A webapp for publishing video to multiple streaming services at once.
Stars: ✭ 281 (-50.35%)
Mutual labels:  stream, streaming
Raw Body
Get and validate the raw body of a readable stream
Stars: ✭ 292 (-48.41%)
Mutual labels:  stream, parser
Rxgo
Reactive Extensions for the Go language.
Stars: ✭ 3,907 (+590.28%)
Mutual labels:  stream, streaming
twitchpipe
Pipe your favorite Twitch streams to the media player of your choice, or a file to save them for later. Supports low-latency playback.
Stars: ✭ 28 (-95.05%)
Mutual labels:  streaming, stream
moestreamer
macOS menubar music player
Stars: ✭ 17 (-97%)
Mutual labels:  streaming, stream
TLightFileStream
Implements a lightweight, high-performance, non-allocating advanced-record-based wrapper around the SysUtils file handling routines as an alternative to Classes.TFileStream.
Stars: ✭ 21 (-96.29%)
Mutual labels:  streaming, stream
Subtitle.js
Stream-based library for parsing and manipulating subtitle files
Stars: ✭ 234 (-58.66%)
Mutual labels:  stream, parser
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (-97.17%)
Mutual labels:  streaming, stream
Stream Parser
⚡ PHP7 / Laravel Multi-format Streaming Parser
Stars: ✭ 391 (-30.92%)
Mutual labels:  parser, streaming
Gnome Shell Extension Cast To Tv
Cast files to Chromecast, web browser or media player app over local network.
Stars: ✭ 200 (-64.66%)
Mutual labels:  stream, streaming
Tributary
Streaming reactive and dataflow graphs in Python
Stars: ✭ 231 (-59.19%)
Mutual labels:  stream, streaming
Node Csv
Full featured CSV parser with simple api and tested against large datasets.
Stars: ✭ 3,068 (+442.05%)
Mutual labels:  parser, streaming

LOL HTML

The logo is generated from https://openmoji.org/data/color/svg/1F602.svg by Emily Jäger which is licensed under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)

Low Output Latency streaming HTML rewriter/parser with CSS-selector based API.

It is designed to modify HTML on the fly with minimal buffering. It can quickly handle very large documents, and operate in environments with limited memory resources. More details can be found in the blog post.

The crate serves as a back-end for the HTML rewriting functionality of Cloudflare Workers, but can be used as a standalone library with a convenient API for a wide variety of HTML rewriting/analysis tasks.

Documentation

https://docs.rs/lol_html/

Bindings for other programming languages

  • C
  • Lua
  • Go (unofficial, not coming from Cloudflare)

Example

Rewrite insecure hyperlinks:

use lol_html::{element, HtmlRewriter, Settings};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut output = vec![];

    let mut rewriter = HtmlRewriter::try_new(
        Settings {
            element_content_handlers: vec![
                element!("a[href]", |el| {
                    let href = el
                        .get_attribute("href")
                        .expect("href was required")
                        .replace("http:", "https:");

                    el.set_attribute("href", &href)?;

                    Ok(())
                })
            ],
            ..Settings::default()
        },
        |c: &[u8]| output.extend_from_slice(c)
    )?;

    rewriter.write(b"<div><a href=")?;
    rewriter.write(b"http://example.com>")?;
    rewriter.write(b"</a></div>")?;
    rewriter.end()?;

    assert_eq!(
        String::from_utf8(output)?,
        r#"<div><a href="https://example.com"></a></div>"#
    );
    Ok(())
}

License

BSD licensed. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].