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

@open-xchange/vite-plugin-proxy

v0.9.2

Published

A OX App Suite specific proxy for developing against multiple vite-dev servers

Downloads

6,546

Readme

@open-xchange/vite-plugin-proxy

An OX App Suite specific proxy for development purposes. Can connect multiple vite-dev-servers with @open-xchange/vite-plugin-ox-manifests plugins.

Install

pnpm i "@open-xchange/vite-plugin-proxy"

Options

You can provide the following options to the plugin:

proxy

An object with reverse proxy configurations, where the keys need to match the beginning of the path. Usually used to forward /api requests to a backend.

  • proxy[key] <string> The key defines which paths should be proxied. Keys starting with ^ will be treated as regular expressions.
  • proxy[key].target <string> The target where to forward these requests to.
  • proxy[key].ws <boolean> If ws is true, this will only listen to upgrade events for a websocket. Default: false
  • proxy[key].rewrite <function> A function that receives the path as parameter and returns the new path to proxy.
  • proxy[key].prependPath <string> A string that is prepended for every request. If prependPath and rewrite are present, the key is first prepended and then rewrite is called.
  • proxy[key].changeOrigin <boolean> Changes the origin of the host header to the target URL. Default: false
  • proxy[key].secure <boolean> Set to false to allow self-signed certificates. Default: true

frontends

An array of objects with frontends to proxy to. A frontend is defined as a server with UI-files and a /manifest endpoint. Every vite-dev server with the @open-xchange/vite-plugin-manifest plugin fullfills this requirement. This plugin will always add the current vite-dev server as the first entry into this array such that serving files from the local machine has always the highest priority.

  • frontends[i].target <string> The target, where to forward requests to.
  • frontends[i].path <string> Optional parameter which will prioritize this frontend for the given path. Is like a reverse proxy configuration for frontends. To indicate a regexp, start the string with a ^.
  • frontends[i].secure <boolean> Set to false to allow self-signed certificates. Default: true

httpProxy

An object for a http proxy to be ususally used with tools like Switchy Omega

  • httpProxy.target <string> The domain which is handled by the vite proxy. You need to make sure, that the proxy configuration is set accordingly.
  • httpProxy.port <number> The port on which the httpProxy server will listen for requests. Default 8080

logLevel

One of fatal, error, warn, info, debug, trace, silent. Default: warn

Example configuration

vitePluginProxy({
  proxy: {
    '/api': {
      target: 'https://path.to.my.middleware/',
      prependPath: '/appsuite',
      rewrite: path => path.replace(/\/v1\//, '/v2/'),
      changeOrigin: true
    },
    '/socket.io/appsuite': {
      target: `wss://path.to.my.middleware/socket.io/appsuite`,
      ws: true,
      changeOrigin: true,
      secure: false
    }
  },
  frontends: [{
    target: 'https://localhost:3000',
    path: '/io.ox/guidedtours',
    secure: false
  }, {
    target: 'https://localhost:3001',
    path: '/io.ox/customplugin',
  }],
  logLevel: 'info'
}),