1.3.0 • Published 1 year ago

localhost-run v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1.3.0

1 year ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago