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

rlay

v1.5.7

Published

Relay HTTP requests through a server to your dev machine. A self hosted alternative to ngrok

Downloads

47

Readme

Rlay is a development tool that allows you to forward HTTP calls to your local machine through a server. Since rlay's client is connecting to the server, you don't need to open any ports on your local machine to make a local webapp available to the external world. It facilitates the development of web applications when another system needs to call a webhook in your system. It is an easy to deploy, self-hosted alternative to ngrok.

It is composed of two components:

  • A server, that you deploy on a machine accessible to the internet, which will receive the HTTP calls, transfer them to the client, then forward the responses.
  • A client, that you run on your local machine. It will connect to a) the distant server, b) whatever app you want on your local machine, and proxy the calls made to the server to your machine.
┌────────────────────────┐     ┌────────────────┐     ┌──────────────────┐
│     Local machine      │     │  Relay server  │     │   Other system   │
│    ───────────────     │     │ ────────────── │     │   ─────────────  │
│                        │     │                │     │                  │
│  App ◄── Rlay client ──┼─────┼►  Rlay server ◄┼─────┼─ External system │
│                        │     │                │     │                  │
└────────────────────────┘     └────────────────┘     └──────────────────┘

Rlay's code is on GitHub, as well as a Kubernetes chart, client and server are available on npmjs, and a docker image is published to dockerhub.

deployment

The recommended deployment is on any kubernetes server you would have dangling around. A helm chart is available in the server's directory, which contains an ingress and certificate.

To make TCP work with Ingress, you need to update the ingress service (a.k.a load balancer) with the additional TCP port:

    - name: proxied-tcp-444
      protocol: TCP
      port: 444
      targetPort: 444
      nodePort: 32092

setup

On the server: deploy rlay either with docker, npm, or using kubernetes. Set the environment variable RLAY_PASSWORD to whatever password you want, and RLAY_PORT to the port to be listened. Rlay will not start if a password is not provided.

On your local machine: npm install -g rlay, then set an environment variable RLAY_PASSWORD to your rlay password, and RLAY_HOST to your rlay server DNS, including the protocol (e.g. https://myrlayserver.mydomain.com).

using

  • Start your local dev server, say it's a webapp listening on port 8080.
  • Configure whatever remote service needs to call it to point to your rlay server (e.g. https://myrlayserver.mydomain.com)
  • Start the rlay client: rlay --port 8080

From there on, when the remote service makes http calls, they will be forwarded to your local environment.

options

-P, --relay-port string Port on relay server. Default is 443 -H, --relay-host string Host of relay server -p, --port string Local port. -H, --https Connect https instead of http. -o, --output Output body in console for debug purposes. -h, --host string Host of local server. Default is localhost --password string Rlay password -t, --tcp Use TCP instead of HTTP --help Display command-line help

deploy to Azure

Rlay can be deployed to a free Webapp on Azure.

  1. Create yourself a free Azure subscription, if you don't have one, then a webapp using Free linux hosting
  2. deploy Rlay by configuring in the App Service configuration > Deployment Center > Settings > External Git repository. Don't use GitHub unless you forked the project and want to use this fork as a source. Use the App Service Build Provider as Build provider. Setup repo as https://github.com/cfe84/rlay.git , branch as main, then save.
  3. Setup password. Go to the webapp settings > Configuration > Application Settings > add a new app setting called RLAY_PASSWORD, set whatever password you want.
  4. Activate websockets. In the same screen, click on General Settings > Web sockets > on. Click Save.
  5. In TLS/SSL settings, turn on "HTTPS only"

Navigate to your web app, after a few minutes it should show No client connected. Install the client on your computer. Set environment variables RLAY_PASSWORD to the same value as the webapp, and RLAY_HOST to the webapp's URL. Be sure to reload whatever terminal you are using to reload the environment. Launch rlay using rlay --port 8080 (use a port that returns something on your machine). Client should connect and display something like Connected to https://YOUR_WEB_APP.azurewebsites.net:443. Refresh your webapp in the browser, it should now forward requests to your client.