NPM Package
The node-proxylens package is the easiest way to integrate ProxyLens into your Node.js applications.
npm install node-proxylens
CLI Usage
You can use ProxyLens directly from the terminal without installing it globally using npx.
npx proxylens <port> [subdomain]
Example: npx proxylens 3000 my-api will try to expose port 3000 at https://my-api.proxylens.dev.
Express Integration
For better debugging context and request logging, integrate directly into your Express app.
1. proxylens.listen(app)
This generic wrapper starts your server and automatically sets up the tunnel and request interceptor.
const express = require('express');
const proxylens = require('node-proxylens');
const app = express();
app.get('/', (req, res) => res.send('Hello World'));
// Replaces app.listen()
proxylens.listen(app, 3000, 'my-subdomain', 'my-auth-token');2. proxylens.middleware
If you don't want to use the tunnel but still want to see requests in the dashboard (local capture only), use the middleware.
const proxylens = require('node-proxylens');
app.use(proxylens.middleware);Configuration
| Argument | Description |
|---|---|
| port | The local port your application is running on. |
| subdomain | (Optional) Custom subdomain to request. |
| token | (Optional) Authentication token for the tunnel connection. |