sse-stream-kotlin
0.1.2indexedSSE HTTP-body codec decoding server-sent events into event streams and encoding SSE events into HTTP bodies; faithful line-by-line transliteration of upstream Rust implementation.
SSE HTTP-body codec decoding server-sent events into event streams and encoding SSE events into HTTP bodies; faithful line-by-line transliteration of upstream Rust implementation.
This is a Kotlin Multiplatform line-by-line transliteration port of 4t145/sse-stream.
Original Project: This port is based on 4t145/sse-stream. All design credit and project intent belong to the upstream authors; this repository is a faithful port to Kotlin Multiplatform with no behavioural changes intended.
This is an in-progress port. The goal is feature parity with the upstream Rust crate while providing a native Kotlin Multiplatform API. Every Kotlin file carries a // port-lint: source <path> header naming its upstream Rust counterpart so the AST-distance tool can track provenance.
4t145/sse-streamThe text below is reproduced and lightly edited from
https://github.com/4t145/sse-stream/. It is the upstream project's own description and remains under the upstream authors' authorship; links have been rewritten to absolute upstream URLs so they continue to resolve from this repository.
A SSE decoder/encoder for Http body
# use sse_stream::SseStream;
# use http_body_util::Full;
# bytes::Bytes;
# futures_util::StreamExt;
SSE_BODY: & =
;
= Full::<Bytes>::(SSE_BODY);
= SseStream::(body);
{
(sse) = sse_body.(). {
(, sse.());
}
};
dependencies {
implementation("io.github.kotlinmania:sse-stream-kotlin:0.1.2")
}
./gradlew build
./gradlew test
See AGENTS.md and CLAUDE.md for translator discipline, port-lint header convention, and Rust → Kotlin idiom mapping.
This Kotlin port is distributed under the same MIT license as the upstream 4t145/sse-stream. See LICENSE (and any sibling LICENSE-* / NOTICE files mirrored from upstream) for the full text.
Original work copyrighted by the sse-stream authors.
Kotlin port: Copyright (c) 2026 Sydney Renee and The Solace Project.
Thanks to the 4t145/sse-stream maintainers and contributors for the original Rust implementation. This port reproduces their work in Kotlin Multiplatform; bug reports about upstream design or behavior should go to the upstream repository.
# use std::convert::Infallible;
# use futures_util::StreamExt;
# use sse_stream::{Sse, SseBody};
let stream = futures_util::stream::iter([
Sse::default().event("1").data("....."),
Sse::default().event("2").data("....."),
Sse::default().event("3").data("....."),
])
.map(Result::<Sse, Infallible>::Ok);
let body = SseBody::new(stream);
Surfaced from shared tags and platforms — no rankings paid for.