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

localhost-gallery-agent

v0.2.1

Published

Local agent for Localhost Gallery - scans your dev servers and streams data to the dashboard

Readme

localhost-gallery-agent

Local agent for Localhost Gallery. Scans your machine for running development servers and streams the data to the dashboard via WebSocket.

Quick Start

npx localhost-gallery-agent

Or if you have it installed globally:

localhost-gallery-agent

How It Works

  1. Visit the dashboard: localhost-ten-tau.vercel.app
  2. Run the agent on your machine: npx localhost-gallery-agent
  3. Dashboard auto-connects and displays your local dev servers

The dashboard connects to ws://localhost:9876 on YOUR machine, so you see YOUR servers. Everyone uses the same dashboard URL but sees their own local services.

┌─────────────────────────────────────────────────────┐
│  Your Browser                                       │
│  ┌───────────────────────────────────────────────┐  │
│  │  localhost-ten-tau.vercel.app                 │  │
│  │  Connects to ws://localhost:9876              │  │
│  └──────────────────────┬────────────────────────┘  │
│                         │                           │
│  ┌──────────────────────▼────────────────────────┐  │
│  │  Your Machine (npx localhost-gallery-agent)   │  │
│  │  - Scans ports every 3 seconds                │  │
│  │  - Sends data via WebSocket                   │  │
│  │  - Handles kill process requests              │  │
│  └───────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────┘

Security

  • Localhost-only binding: The agent only listens on 127.0.0.1:9876, not 0.0.0.0. This means only local connections are accepted.
  • No auth required: Since you explicitly run the agent and it only accepts localhost connections, no authentication is needed.
  • Kill validation: You can only kill processes that are in the currently scanned port list.

WebSocket Protocol

Server → Client

// Port data (sent every 3 seconds)
{ type: 'ports', data: PortInfo[], timestamp: number }

// SSH connections (sent every 3 seconds)
{ type: 'ssh', data: SSHConnection[], timestamp: number }

// Kill result
{ type: 'kill_result', success: boolean, message: string, pid: number }

// Heartbeat response
{ type: 'pong', timestamp: number }

Client → Server

// Kill a process (works for both ports and SSH connections)
{ type: 'kill', pid: number }

// Heartbeat
{ type: 'ping' }

SSH Connection Detection

The agent also detects active SSH client connections, including:

  • Remote host and user
  • SSH tunnels (local and remote port forwards)
  • Connection uptime
  • Remote IP address

Development

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build for production
npm run build

# Run production build
npm start

Scanned Ports

The agent scans these port ranges:

  • 3000-3010 (Next.js, React, etc.)
  • 4000-4010
  • 5000-5010 (Vite, Flask, etc.)
  • 5173, 5174 (Vite)
  • 8000, 8080, 8888, 8443 (Django, generic servers)
  • 9000, 9090

Detected Frameworks

The agent can detect and identify:

  • Frontend: Next.js, Vite, Create React App, Vue CLI, Nuxt, Remix, Astro, SvelteKit, Gatsby, Webpack, Parcel
  • Backend: Express, NestJS, Fastify, Hono, Django, Flask, FastAPI, Rails, Laravel, Go, Rust
  • Database: PostgreSQL, MySQL, MongoDB, Redis
  • Tools: Storybook, Prisma Studio, Drizzle Studio, GraphQL Playground