New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-frp2

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-frp2

> frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, where requests can be forwarded to internal services by domain name.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

Node FRP (node-frp2)

frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, where requests can be forwarded to internal services by domain name.

Use frp as an npm module for tighter integration with node apps (e.g. test fixtures).

Note: This automatically downloads and runs the frpc or frps binary for the installer's operating system.

Usage

npm install node-frp2

// Web service to proxy (on client)
const webService = micro((req, res) => res.end("Hello world!"))
webService.listen(5000)

// Start FRPS server (normally you do this on a remote server with a public ip)
const server = await frp.startServer({
  common: {
    bindPort: 7000,
  },
})

// The frpc client requests to forward from 5000 locally to 2000 remotely
// through frps
const client = await frp.startClient({
  common: {
    serverPort: 7000,
    serverAddr: "127.0.0.1",
  },
  ssh: {
    type: "tcp",
    localIp: "127.0.0.1",
    localPort: 5000,
    remotePort: 2000,
  },
})

const response = await request(`http://127.0.0.1:2000`)
// response === "Hello world!"

FAQs

Package last updated on 02 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts