@bss-sbc/tunnel
TypeScript icon, indicating that this package has built-in type declarations

1.3.81 • Public • Published

Shopify App Tunnel

A simple npm package to run Cloudflare tunnel for Shopify apps in Node.js.

Installation

Using npm:

$ npm install --save-dev @bss-sbc/tunnel

Using yarn:

$ yarn add -D @bss-sbc/tunnel

Usage

Using Cloudflare quick tunnel:

const { useCloudflareTunnel } = require("@bss-sbc/tunnel");
(async () => {
  const tunnelUrl = await useCloudflareTunnel(8001);
  console.log("Tunnel url: ", tunnelUrl)
}) ()

Using Cloudflare Zero Trust:

const { CloudflareTunnel } = require("@bss-sbc/tunnel");

const cfTunnel = new CloudflareTunnel({
  certPath: 'home/bar/.cloudflared/cert.pem',
  cfAccountTag: 'daca032c1f89e3d5gfdg34dfg',
  cfSecretKey: "k5meSe4CiZhC5IyJjDKOfsdxcvzbMGsVl66FK6CryWgQ=",
  tunnelName: "my-tunnel",
  tunnelOptions: {
      connectTimeout: "25s",
  },
  tunnels: [
      {
          hostname: "abc.example.com",
          service: "http://localhost:3000"
      },
      {
          hostname: "bcd.example.com",
          service: "http://localhost:3001"
      }
  ],
  debug: true
})

cfTunnel.start();

References:

Package Sidebar

Install

npm i @bss-sbc/tunnel

Weekly Downloads

2

Version

1.3.81

License

MIT

Unpacked Size

18.3 kB

Total Files

17

Last publish

Collaborators

  • hiepnguyennk
  • midadean
  • xhoang0509