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

plug2proxy

v0.3.0-30

Published

[![NPM version](https://img.shields.io/npm/v/plug2proxy?color=%23cb3837&style=flat-square)](https://www.npmjs.com/package/plug2proxy) [![Repository package.json version](https://img.shields.io/github/package-json/v/vilicvane/plug2proxy?color=%230969da&lab

Downloads

204

Readme

NPM version Repository package.json version MIT License Discord

Plug2Proxy - 插入代理

Plug2Proxy 并非科学上网/翻墙工具,它主要用于需要稳定访问特定 API 的服务器程序,如手机消息推送、OAuth 鉴权等场景。使用 Plug2Proxy 需要当前网络有公网 IP,并不适用于一般的家庭网络。

常见的代理方案需要配置客户端连接特定的代理服务器,当代理服务器失效时,则需要逐一登录客户端进行配置,既不方便,也容易遗漏。

Plug2Proxy 则将原来的客户端作为服务器,由流量出口(代理服务器)主动连接和配置规则。只需要更换流量出口服务器或其 IP,即可实现代理的切换。

特性

  • 流量出口服务器无需暴露端口(入口需要有公网 IP)。
  • 支持浏览器请求 referer 嗅探匹配规则(需要信任本地生成的 Plug2Proxy CA)。
  • 内置 DDNS 配置,目前支持阿里云和 Cloudflare 的 DNS 解析服务。

安装

npm install --global plug2proxy

使用

p2p [config file]

Plug2Proxy 使用 cosmiconfig 读取配置文件。

典型配置

流量入口

p2p.config.mjs

export default {
  mode: 'in',
  alias: '🖥️',
  tunnel: {
    password: 'abc123',
  },
  proxy: {
    refererSniffing: {
      include: {
        browsers: ['Edge', 'Chrome', 'Safari'],
      },
    },
  },
  ddns: {
    provider: 'alicloud',
    accessKeyId: '[access key id]',
    accessKeySecret: '[access key secret]',
    domain: 'example.com',
    // 使用泛域名解析避免缓存。
    record: '*.p2p',
  },
};

更多配置请参考 src/library/in/config.ts

流量出口

p2p.config.mjs

export default {
  mode: 'out',
  alias: '🌎',
  tunnels: [
    {
      // 字符 # 会在连接时被替换成随机字符串,配合泛域名使用。
      host: '#.p2p.example.com',
      password: 'abc123',
      rejectUnauthorized: false,
      match: {
        include: [
          {
            type: 'geoip',
            match: 'CN',
            negate: true,
          },
        ],
      },
      replicas: 3,
    },
  ],
};

更多配置请参考 src/library/out/config.ts

License

MIT License.