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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fp-multi

v0.0.4

Published

FRP Plugin: Multi-user support with configurable name, type, and port range restrictions. Supports token and URL authentication.

Readme

fp-multi

简体中文

A plugin that enables multi-user support for frp, with restrictions on proxy names, proxy types, port ranges, and domain per user. Supports file token / server authentication modes.

Note

Before using this plugin, ensure you have a basic understanding of frp usage and configuration file formats.

Usage

In a Node.js 22+ environment, install fp-multi globally:

$ npm i fp-multi -g

Configuration File Example

{
    "port": 7200,
    "users": [
        {
            "user": "user1",
            "token": "token1",
            "name": [
                "user1",
                "/user1-[0-9]+/"
            ],
            "type": [
                "tcp",
                "udp",
                "http"
            ],
            "port": [
                "7000-7010",
                "7020-7030",
                "8000"
            ],
            "domains": [
                "test-*.maiyun.net"
            ]
        }
    ],
    "server": {
        "url": "https://example.com/auth",
        "auth": "auth1"
    }
}

If any of name, type, or port doesn't meet the rules, the connection will be rejected. name supports regular expressions, and port supports port ranges.

Simplified Configuration File Example

{
    "port": 7200,
    "users": [
        {
            "user": "user1",
            "token": "token1"
        }
    ]
}

Authentication Order

If users authentication fails, it will then request the server. If server authentication also fails, the connection will be rejected. So you can either not configure users and only configure server, or only configure users without server.

{
    "port": 7200,
    "server": {
        "url": "https://example.com/auth",
        "auth": "auth1"
    }
}

With the above configuration, authentication is completely handled by you.

Server Authentication

When users is not configured or users authentication fails, data will be POSTed to the server, and it must return in the specified format.

Sent Data Format

login

When frpc connects to frps, it sends a login action. auth is the server.auth from fp-multi configuration file, user is the user from frpc configuration file, and token is the metadatas.token from frpc configuration file.

{
    "action": "login",
    "auth": "auth1",
    "user": "user1",
    "token": "token1",
}
new

After frpc successfully connects to frps, it will create proxies according to [[proxies]] configuration in sequence. At this point, a new action is initiated. user and token are sent again, and you must re-validate the user's legitimacy in this action before validating other proxy fields.

port is the remotePort from frpc configuration file.

{
    "action": "new",
    "auth": "auth1",
    "user": "user1",
    "token": "token1",
    "name": "user1-1",
    "type": "tcp",
    "port": 7000
}

Return Data Format

{
    "result": 1
}

A result greater than 0 indicates permission, while less than or equal to 0 indicates rejection.

auth

The server.auth value from fp-multi will be sent as-is to prevent third parties from making unauthorized requests to your authentication interface.

Configure frps

[[httpPlugins]]
addr = "127.0.0.1:7200"
path = "/handler"
ops = ["Login", "NewProxy"]

Port 7200 can be customized, see Configuration File.

Configure frpc

It's recommended to set loginFailExit to false so that frpc won't exit when login fails or network connection is lost, but will continue trying to login.

user1

serverAddr = "127.0.0.1"
loginFailExit = false
user = "user1"
metadatas.token = "token1"

[[proxies]]
name = "user1-6000"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000

user2

serverAddr = "127.0.0.1"
loginFailExit = false
user = "user2"
metadatas.token = "token2"

[[proxies]]
name = "user2"
type = "tcp"
localPort = 22
remotePort = 6001

Direct Startup

$ fpmulti -c /etc/fp-multi/config.json

After starting, launch frps to begin normal usage.

systemd Startup

  1. Create a service file
$ sudo nano /etc/systemd/system/fpmulti.service
  1. Write the file content
[Unit]
Description = fp multi
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
ExecStart = fpmulti -c /etc/fp-multi/config.json

[Install]
WantedBy = multi-user.target
  1. It's recommended to coordinate with frps service so that when frps service starts automatically, it also forces fpmulti.service to start. Create frps.service file:
$ sudo nano /etc/systemd/system/frps.service
  1. Write the file content
[Unit]
Description = frp server
After = fpmulti.service
Requires = fpmulti.service

[Service]
Type = simple
# Command to start frps, modify to actual frps path
ExecStart = /path/to/frps -c /path/to/frps.toml

[Install]
WantedBy = multi-user.target
  1. Set frps.service to start on boot
$ sudo systemctl enable frps

License

This library is published under AGPL-3.0 license.