How to do HLS streaming with javelin?

I'm new to Rust.

I want to try using HLS server with rust.
I have chosen javelin for the tryout.

I checked the server worked as a RTMP server, and then, I tried to make sure the server works as a HLS server as well.

Although I have read the source code of javelin, I don't know how to check it out.

I think web/ has a role of http server.

use {
    warp::{Filter, Reply, Rejection, http::StatusCode},
        Error as ApiError,

macro_rules! json_error_response {
    ($code:expr, $message:expr) => {{
        let json = json!({ "error": $message });
        let reply = warp::reply::json(&json);
        Ok(warp::reply::with_status(reply, $code))

pub struct Server {
    shared: Shared,

impl Server {
    pub fn new(shared: Shared) -> Self {
        Self { shared }

    pub fn start(&mut self) {
        let shared = self.shared.clone();
        thread::spawn(|| server(shared));

fn server(shared: Shared) {
    let addr = {
        let config =;

    let hls_root = {
        let config =;

    let hls_files = warp::path("hls")

    let streams_api = warp::path("api")

    let routes = hls_files


fn error_handler(err: Rejection) -> Result<impl Reply, Rejection> {
    match err.find_cause() {
        | Some(e @ ApiError::NoSuchResource)
        | Some(e @ ApiError::StreamNotFound) => {
            json_error_response!(StatusCode::NOT_FOUND, e.to_string())
        None => Err(err)

I didn't find a part of streaming hls data not only in this code, but any codes in the project.
So I think I have to add some codes to run HLS streaming with javelin.

Do you know how to run the javelin server?


If I've read it right, it looks like HLS streaming is an open issue in javelin:, and the author is not currently implementing this.

If you want to implement this, maybe you could coordinate with the person who reported that, or show your support on that gitlab issue?

1 Like

I see,
I tried to implement the HLS streaming function on javelin.

It does not still work properly.
So I'll show it when I implement the hls streaming function.


1 Like

Hey, that is interesting.

I know nothing much about video or streaming it. Just now I need to push the output of a camera to a server so that it could then be viewed by connected clients somehow.

I hobbled something together with ffmpeg fetching the stream from the camera and pushing it to an nginx server as RTMP. From their I can view the stream in the browser using HLS or in something like VLC using RTMP.

A self contained Rust server to do just that job might me very nice.

1 Like

Thanks :heartbeat:
Someday I implement hls function on javelin!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.