npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tauri-plugin-httpd-api

v0.1.0

Published

A Tauri plugin that provides multi-instance HTTP server support.

Readme

Tauri Plugin httpd

A Tauri plugin that provides multi-instance HTTP server support. Built on Axum, it allows you to run multiple dynamic API routers and static file servers on different ports simultaneously, with native support for Tauri's path variables (e.g., $APPDATA).

Features

  • Multi-port Listening: Spin up multiple HTTP instances in one plugin instance.

  • Hybrid Modes: Host an Axum Router on one port and static assets on another.

  • Path Resolution: Native support for $APPDATA, $RESOURCE, and other Tauri's path variables.

  • Async Performance: Powered by the Tauri async runtime; won't block your main thread.

Installation

  1. Add the dependency to your src-tauri/Cargo.toml:
[dependencies]
tauri-plugin-httpd = { git = "https://github.com/alwynkalleii/tauri-plugin-httpd", branch = "v2" }
  1. Modify lib.rs to initialize the plugin:
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
  tauri::Builder::default()
+    .plugin(tauri_plugin_httpd::init())
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}
  1. Install the JavaScript Guest bindings using your preferred JavaScript package manager:
npm add tauri-plugin-httpd-api

Usage

1. Static Path Resolution

The listen_static method supports the following path formats:

use tauri_plugin_httpd::HttpdExt;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
  tauri::Builder::default()
    .plugin(tauri_plugin_httpd::init())
    .setup(|app| {
      let app_handle = app.handle().clone();

      tauri::async_runtime::block_on(async move {

        app_handle.httpd().listen_static("static_service", 12345, "$APPDATA").await.expect("Failed to start static service");

      });

      Ok(())
    })
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

or use javescript:

import { getServices, stopService, listenStatic } from "tauri-plugin-httpd-api";

await listenStatic("static_service", 12345, "$APPDATA");

const services = await getServices();
console.log(services);

await stopService("static_service");

Supported Formats:

  • Absolute Paths: e.g., C:\Users\Name\Documents (Windows) or /var/www (Linux).

  • Tauri Variables: Supports all Tauri Path Variables such as $APPDATA, $RESOURCE, $DOCUMENT, etc.

2. Custom Router

Add axum to your dependencies (required to define custom router):

cargo add axum

The listen method supports custom your router:

use axum::{routing::get, Router};
use tauri_plugin_httpd::HttpdExt;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
  tauri::Builder::default()
    .plugin(tauri_plugin_httpd::init())
    .setup(|app| {
      let app_handle = app.handle().clone();

      tauri::async_runtime::block_on(async move {

        let router = Router::new()
          .route("/", get(|| async { "Hello!" }))
          .route("/test", get(|| async { "Success" }));

        app_handle.httpd().listen("custom_router", 12345, router).await.expect("Failed to start static service");

      });

      Ok(())
    })
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

Permissions

This default permission set includes the following:

  • allow-stop-service
  • allow-get-services
  • allow-listen-static

License

MIT