New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

localhost-run

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localhost-run

Node client for localhost.run

latest
Source
npmnpm
Version
1.4.0
Version published
Weekly downloads
3
-82.35%
Maintainers
1
Weekly downloads
 
Created
Source

Localhost.run

Open a tunnel with localhost.run and expose the url

import { createExternalUrl } from "localhost-run";

const result = await createExternalUrl({ port: 3000 });

console.log(result);

// Prints
// {
//   domain: '1234.lhrtunnel.link',
//   secure: 'https://1234.lhrtunnel.link',
//   insecure: 'http://1234.lhrtunnel.link',
// }

Using custom domains

You can use custom domain as well, if you have an active subscription

import { createExternalUrl } from "localhost-run";

const result = await createExternalUrl({
  port: 3000,
  domain: tunnel.example.com,
});

console.log(result);

// Prints
// {
//   domain: 'tunnel.example.com',
//   secure: 'https://tunnel.example.com',
//   insecure: 'http://tunnel.example.com',
// }

Closing the tunnel

import { createExternalUrl } from "localhost-run";

const tunnel = await createExternalUrl({
  port: 3000,
});

tunnel.close(); // returns true when succeded

Notes

This is a little personal project, it's not affiliated with localhost.run.
This software currently rely on the presenc of ssh binary in your environment

FAQs

Package last updated on 03 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts