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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mikesposito/tunnelify-local-server

v0.3.1

Published

Expose static files and folders to an https url with one command

Downloads

21

Readme

tunnelify

GitHub license npm version npm downloads CircleCI codecov CodeQL PRs Welcome

A simple tool that exposes static folders from your local machine to the web

Concept Image

Table of Contents

Features

Released

  • Expose a local directory to an HTTP port
  • Create a remotely accesible url
  • Expose your local tunnelify server on the remote url
  • Create your custom remote tunnel provider
  • Public, Free and Predefined provider https://tnlfy.live

WIP

  • More sophisticated Tunnel management for the Provider
  • Better Provider configuration for a more customizable experience

Install

With npm, for global usage:

$ npm install -g @mikesposito/tunnelify

With npm, for usage in another project:

$ npm install --save @mikesposito/tunnelify

# OR FOR DEVELOPMENT ONLY:
$ npm install --save-dev @mikesposito/tunnelify

Usage

With Command Line

Tunnelify only requires an absolute or relative path of the directory containing files you want to expose:

$ tunnelify <PATH>

Tunnelify will expose your path on these addresses:

  • http://localhost:32000/
  • https://folder-name-xxxxx.tnlfy.live/

xxxxx will be a random generated string by the remote provider

Instead of folder-name you can use a different name using flag -n or --name:

$ tunnelify -n <NAME> <PATH>

Custom Port

You can use -p <PORT> to use a custom port number for the local server:

$ tunnelify -p <PORT> <PATH>

Custom Provider

You can use -r <REMOTE_PROVIDER_URL> to use a different Tunnelify Provider other than the public, free and default https://tnlfy.live

$ tunnelify -r <REMOTE_PROVIDER_URL> <PATH>

If you want to use your custom domain when using tunnelify, read section Use a Custom Remote Domain

From another application

Tunnelify can also be used from other javascript applications. You can use the main Tunnelify class to instantiate a tunnel:

const { Tunnelify } = require("@mikesposito/tunnelify");

const tunnelify = new Tunnelify({
  src: "./path/to/files",
  remote: `https://tnlfy.live`,
  port: 32000,
  silent: false,
  verbose: false
});

tunnelify.run();

Examples

Minimal:

$ tunnelify ./my-folder

With custom port:

$ tunnelify -p 3000 ./my-folder

With custom Tunnelify Provider:

$ tunnelify -r https://my-domain.com ./my-folder

Use a Custom Remote Domain

You can create you own remote Tunnelify Provider to expose files on your private domains.

1. Install Tunnelify Provider

With NPM

$ npm install -g @mikesposito/tunnelify-provider

With Docker

If you want to use Docker, you can jump to run with docker step

2. Run Tunnelify Provider

If installed with NPM

$ tunnelify-provider -h <HOSTNAME>

Where <HOSTNAME> should be your domain.

Example:

$ tunnelify-provider -h my-domain.com

By default, tunnelify-provider will listen on port 9410, but you can choose a different port with -p:

$ tunnelify-provider -h my-domain.com -p 8080

Run with Docker

$ docker run -p 9410:9410 --env TUNNELIFY_HOST=my-domain.com mikesposito/tunnelify-provider

3. Configure DNS

In order to use the dynamic tunnel name resolution on your doman, you will have to add the following DNS "A" records to your domain:

A   <your-server-ip>    @
A   <your-server-ip>    *.my-domain.com

To use https tunnels, you will have to configure a reverse proxy like NGINX to offload the SSL certificates. You can find the Helm Chart we use on our Kubernetes cluster for serving https://tnlfy.live

Note: The reverse proxy will need a wildcard certificate to handle the *.my-domain.com dynamic resolution

4. Configure Redis to give permanent tunnel names (optional)

By default, tunnelify-provider will create a new tunnel name for each new connection, event if the client is the same. You can optionally configure a Redis server reachable by the provider, to make tunnel names persistent, bound to a token. To do that, you have to choose redis as storage option for the tunnelify-provider command:

$ tunnelify-provider -h my-domain --storage redis --redisHost 127.0.0.1 --redisPort 6379

You can use your own host and port values for redis.

Note: ATM, redis is the only value supported for --storage

Contributing

The main purpose of this repository is to continue evolving tunnelify core, making it faster and easier to use. Development of tunnelify happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving tunnelify.

Code of Conduct

tunnelify has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to tunnelify.

Good First Issues

To help you get your feet wet and get you familiar with our contribution process, we have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started.

License

Tunnelify is MIT licensed.