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

meteorproxy

v1.0.6-patch.1

Published

The modern interception proxy you've been waiting for

Downloads

265

Readme


[!WARNING] Meteor is in a very early stage of development. Mainstream site support is not guaranteed. You can see our roadmap here.

The modern interception proxy you've been waiting for.

Meteor is a web proxy powered by service workers that intercepts HTTP requests and routes them through a Wisp server using bare-mux.

Installation

Meteor is a client-side JavaScript library. You can install it in your application in one of two ways:

  1. Hosting manually

Build Meteor's scripts by first cloning the repository, installing packages (pnpm install), running pnpm build and copy the files in the dist/ folder into a meteor folder in your application's folder.

  1. Serving a static path with a backend framework

meteorPath is exported from the meteorproxy NPM package, which resolves to a path in node_modules of built Meteor scripts. You can use this however you serve static directories in your backend framework.

Express:

import express from 'express'
import { meteorPath } from 'meteorproxy'

const app = express()
app.use("/meteor/", express.static(meteorPath)

Fastify:

import Fastify from 'fastify'
import fastifyStatic from '@fastify/static'
import { meteorPath } from 'meteorproxy'

Fastify()
  .register(fastifyStatic, {
    root: meteorPath,
    prefix: '/meteor/'
  })

You can use this path with the vite-plugin-static-copy Vite plugin in your Vite (or Vite-powered) app to copy Meteor scripts into your assets directory. Install vite-plugin-static-copy with your favorite package manager and use the path in the plugin's configuration.

import { defineConfig } from 'vite'
import { meteorPath } from 'meteorproxy'
import { viteStaticCopy } from 'vite-plugin-static-copy'

export default defineConfig({
  plugins: [
    // ...
    viteStaticCopy({
      targets: [
        {
          src: `${meteorPath}/meteor.*`.replace(/\\/g, "/"),
          dest: "meteor",
          overwrite: false,
        },
      ],
    })
  ]
})

Usage

Once you have the scripts served, register your service worker and set your transport on your frontend.

if ('serviceWorker' in navigator) {
    const registration = await navigator.serviceWorker.register('/sw.js')
    BareMux.SetTransport(
      "EpxMod.EpoxyClient", // replace with your transport
      { wisp: `wss://wisp-server-here.com` } // replace with the url of your wisp server
    )
  })
}

// After a button click or other event:
iframe.src = self.$meteor.util.formatUrl("https://google.com"") // replace with a chosen url

[!IMPORTANT] During our testing, we've found that Meteor only supports being viewed inside iframes due to a limitation with bare-mux.

More in-depth usage and configuration will be coming soon in a Wiki.

Testing and development

Running pnpm demo will serve a UI to test Meteor, along with a dev server that watches for changes in the source code and re-builds accordingly.