node-proxylens 1.2.0 → 1.3.0
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 +7 -0
- package/README.md +82 -27
- package/out/dist-obf/proxylens.js +61 -0
- package/package.json +14 -8
- package/bin/proxylens.js +0 -91
- package/index.js +0 -289
- package/lib/ProxyLens.js +0 -289
- package/lib/api.js +0 -51
- package/lib/commands/login.js +0 -24
- package/lib/commands/logout.js +0 -32
- package/lib/commands/whoami.js +0 -30
- package/lib/config.js +0 -30
- package/lib/constants.js +0 -15
- package/lib/modes/local.js +0 -86
- package/lib/modes/tunnel.js +0 -197
- package/lib/ui.js +0 -32
package/LICENSE
ADDED
package/README.md
CHANGED
|
@@ -1,45 +1,100 @@
|
|
|
1
|
-
# ProxyLens
|
|
1
|
+
# ProxyLens CLI
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
15
|
+
npm install -g node-proxylens
|
|
9
16
|
```
|
|
10
17
|
|
|
11
|
-
## Usage
|
|
18
|
+
## CLI Usage
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
const server = http.createServer(app);
|
|
43
|
+
*Note: You may need to login to use custom subdomains.*
|
|
20
44
|
|
|
21
|
-
|
|
22
|
-
const lens = new ProxyLens(server);
|
|
45
|
+
### ProxyLens Dashboard
|
|
23
46
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
87
|
+
const uiServer = http.createServer();
|
|
88
|
+
const lens = new ProxyLens(uiServer, {
|
|
89
|
+
proxyTarget: 'http://localhost:3000'
|
|
31
90
|
});
|
|
32
91
|
|
|
33
|
-
// Start
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
##
|
|
98
|
+
## License
|
|
41
99
|
|
|
42
|
-
|
|
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.
|