node-proxylens 1.2.1 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2025 ProxyLens
2
+
3
+ All rights reserved.
4
+
5
+ This software is licensed, not sold.
6
+ You may not copy, modify, distribute, sublicense, or reverse engineer
7
+ this software except as explicitly permitted by ProxyLens.
package/README.md CHANGED
@@ -1,45 +1,100 @@
1
- # ProxyLens Node SDK
1
+ # ProxyLens CLI
2
2
 
3
- Connect your local Node.js/Express application to the ProxyLens AI Inspector.
3
+ **[ProxyLens](https://proxylens.dev)** is an AI-powered traffic inspector for your local development environment. This package provides the CLI and Node.js SDK to connect your local applications to the ProxyLens dashboard.
4
+
5
+ ## Features
6
+
7
+ - **Traffic Inspection**: View and analyze HTTP/HTTPS requests in real-time.
8
+ - **Tunneling**: Expose your local server to the internet with a secure tunnel.
9
+ - **Request Replay**: Replay requests to test your backend.
10
+ - **AI Analysis**: Get AI-driven insights into your API traffic (via dashboard).
4
11
 
5
12
  ## Installation
6
13
 
7
14
  ```bash
8
- npm install proxylens-node
15
+ npm install -g node-proxylens
9
16
  ```
10
17
 
11
- ## Usage with Express
18
+ ## CLI Usage
12
19
 
13
- ```javascript
14
- const express = require('express');
15
- const http = require('http');
16
- const ProxyLens = require('proxylens-node');
20
+ ### Start Proxying
21
+
22
+ To start proxying traffic to your local server:
23
+
24
+ ```bash
25
+ # Proxy to a local port (e.g., 3000)
26
+ proxylens 3000
27
+
28
+ # Proxy to a specific URL
29
+ proxylens http://localhost:8080
30
+ ```
31
+
32
+ Running this command will start a proxy server (default port 8000) and open the web dashboard.
33
+
34
+ ### Public Tunneling
35
+
36
+ To expose your local server to the internet using a public subdomain:
37
+
38
+ ```bash
39
+ # Expose port 3000 with a random or shared subdomain
40
+ proxylens 3000 -d my-app
41
+ ```
17
42
 
18
- const app = express();
19
- const server = http.createServer(app);
43
+ *Note: You may need to login to use custom subdomains.*
20
44
 
21
- // 1. Initialize ProxyLens with your HTTP server
22
- const lens = new ProxyLens(server);
45
+ ### ProxyLens Dashboard
23
46
 
24
- // 2. Add Middleware (before your routes)
25
- app.use(express.json()); // Ensure body parsing is enabled if needed
26
- app.use(lens.middleware());
47
+ Visit [proxylens.dev](https://proxylens.dev) to:
48
+ - Get your authentication token for the CLI.
49
+ - Manage your domains and tunnels.
50
+ - View and analyze your traffic history.
51
+ - Collaborate with your team.
52
+
53
+ **View Live Traffic:** Go to [proxylens.dev/interceptor](https://proxylens.dev/interceptor) to see all your traffic in real-time.
54
+
55
+ ### Authentication
56
+
57
+ Manage your ProxyLens account directly from the CLI.
58
+
59
+ ```bash
60
+ # Login with your authentication token
61
+ proxylens login <your-token>
62
+
63
+ # Check which account you are logged in as
64
+ proxylens whoami
65
+
66
+ # Logout from the CLI
67
+ proxylens logout
68
+ ```
69
+
70
+ ### Options
71
+
72
+ | Flag | Description |
73
+ |------|-------------|
74
+ | `target` | The target URL or port to proxy to (e.g., `3000` or `http://localhost:3000`). |
75
+ | `[port]` | Optional. The port for ProxyLens to listen on (default: `8000`). usage: `proxylens <target> <port>` |
76
+ | `-d <subdomain>` | Request a specific subdomain for the public tunnel. |
77
+ | `-u <url>` | Specify a custom server URL (for self-hosted ProxyLens instances, Enterprise option). |
78
+ | `--domain <domain>` | Specify a custom root domain (advanced usage). |
79
+
80
+ ## Node.js SDK (COMING SOON)
81
+ You can also use ProxyLens programmatically in your Node.js applications.
82
+
83
+ ```javascript
84
+ const { ProxyLens } = require('node-proxylens');
85
+ const http = require('http');
27
86
 
28
- // Your Routes
29
- app.get('/api/users', (req, res) => {
30
- res.json([{ name: 'Alice' }, { name: 'Bob' }]);
87
+ const uiServer = http.createServer();
88
+ const lens = new ProxyLens(uiServer, {
89
+ proxyTarget: 'http://localhost:3000'
31
90
  });
32
91
 
33
- // Start Server
34
- server.listen(3000, () => {
35
- console.log('Server running on port 3000');
36
- console.log('ProxyLens Inspector WebSocket available at ws://localhost:3000/_proxylens');
92
+ // Start the UI server
93
+ uiServer.listen(8000, () => {
94
+ console.log('ProxyLens dashboard running at http://localhost:8000');
37
95
  });
38
96
  ```
39
97
 
40
- ## Connecting the UI
98
+ ## License
41
99
 
42
- 1. Open ProxyLens Web App.
43
- 2. Click **Connect Local** in the header.
44
- 3. Enter `ws://localhost:3000/_proxylens` (default).
45
- 4. Watch your traffic appear in real-time!
100
+ Copyright (c) 2025 ProxyLens. All rights reserved.