whistle.pastekitlab 1.3.6 → 1.3.8

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.
Files changed (2) hide show
  1. package/index.js +11 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,16 +1,20 @@
1
- module.exports = (ctx, options) => {
2
- ctx.addRules({
3
- 'pastekitlab': (req, res, next) => {
4
- console.log('📡 proxy request:', req.fullUrl);
1
+ // index.js
2
+ module.exports = (req, res, next) => {
3
+ console.log('>>> takeover:', req.fullUrl,next);
5
4
 
6
- // 放行请求
7
- next(); // ✅ 正确!
5
+ // 主拦截逻辑
6
+ };
7
+
8
+ // 额外暴露 Web UI(可选)
9
+ module.exports.ui = (server, options) => {
10
+ server.on('request', (req, res) => {
11
+ if (req.url === '/plugin/pastekitlab/config') {
12
+ res.end(JSON.stringify({ status: 'ok' }));
8
13
  }
9
14
  });
10
15
  };
11
16
 
12
17
 
13
-
14
18
  // (server, options) => {
15
19
  // console.log('>>> plugin loaded');
16
20
  // // server.on('request', (req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.pastekitlab",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Whistle plugin for PasteKit Lab - Intercepts requests and sends them to requestlistviewer via WebSocket",
5
5
  "main": "index.js",
6
6
  "scripts": {