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

@shankha/https-forward

v0.0.8

Published

A simple proxy server to forward requests to your local or development server.

Readme

https-forward

NPM NPM NPM

Simple proxy forward for incoming HTTP/HTTPs requests. Built for node.js/io.js.
*Note: Make sure you are using node version 14 or higher

Installation

npm install @shankha/https-forward -g

API

NodeJS usage

const Server = require('@shankha/https-forward')

new Server().create({
    target: "https://127.0.0.1",    // ex: For remote servers https://example.com
    localPort: 9000,
    tlsKey: <path/to/ssl/key>,      // Optional
    tlsCert: <path/to/ssl/cert>     // Optional
}).init()

CLI usage

https-forward -c ./<path/to/configuration/file>
https-forward --config ./<path/to/configuration/file>

or

https-forward -p 3000 -t https://example.com
https-forward --port 3000 --target https://example.com

CLI with SSL

https-forward -p 3000 -t https://example.com --key <path/to/ssl/key> --cert <path/to/ssl/cert>

Run with PM2

  • Create config file https-forward-config.json
{
    "target": "http://xxxx-xxxx-xxxx-xxxx.ngrok.io",
    "localPort": 5000,
    "tlsKey": "/path/to/key.pem",
    "tlsCert": "/path/to/cert.pem",
}
  • Create a bash script https-forward.sh
#!/usr/bin/bash
https-forward -c ./https-forward.json
  • All Done, Now you need to run you PM2
pm2 start https-forward.sh

USE CASE

This package is a simple but powerful tool to forward all the incoming http or https requests to some other server. Now you can use this package in various ways.

You can run your main server to port 8080 (let's say') but you can expose another port to the client.

Lets say your actual server is running on port 1220, but you can map the port to port let's say 80. This is how you are exposing only port 80 but in reality your application is running on port 1220. How cool is that. Now you can run some statistical thing or can add more security features before sending the request without hampering the main server code.

https-forward -p 1220 -t http://127.0.0.1:80

You can tunnel your remote server to your local machine

When you are developing the backend and your frontend team members are also using the remote server URL as there BaseURL. But some time you might have the feeling that if the frontenders role out a build with a BaseURL the connected to your local machine. Yes you can do this by setting up ngrok in your system. But once you restart your machine, your ngrok public url will be changed. Now you need to ask the frontenders again to give you a build with the new ngrok url. And I think they will get mad at this point!

So here is you solution, you can tunnel your remote server to your local machine using the ngrok url and the frontend app can still use it the remote server url. This way you can tunnel your remote server any time and you are not relying on your frontend team members.

*Note: You can use any of the localport tunnelling software like ngrok, localhost.run etc.

https-forward -p 1220 -t http://xxxx-xxxx-xxxx-xxxx.ngrok.io

License

MIT - Shankhadeep Das