Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 72fea95

Browse files
committed
fix traffic/all bug
1 parent 1be18ac commit 72fea95

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

app.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
throw new Error("illegal argument");
8282

8383
case 9:
84-
d.addPort({
84+
g.addPort({
8585
port: t,
8686
password: n
8787
});
@@ -104,7 +104,7 @@
104104
throw new Error("illegal argument");
105105

106106
case 2:
107-
return e.next = 5, d.removePort(r);
107+
return e.next = 5, g.removePort(r);
108108

109109
case 5:
110110
case "end":
@@ -118,7 +118,7 @@
118118
return regeneratorRuntime.wrap(function(e) {
119119
for (;;) switch (e.prev = e.next) {
120120
case 0:
121-
return r = d.getPorts(), e.abrupt("return", r);
121+
return r = g.getPorts(), e.abrupt("return", r);
122122

123123
case 2:
124124
case "end":
@@ -148,7 +148,7 @@
148148
});
149149
};
150150
}
151-
var p = t(1), f = t(2), l = (t(0)("dao"), f.resolve(__dirname, "./ports.json")), d = {
151+
var p = t(1), f = t(2), l = (t(0)("dao"), f.resolve(__dirname, "./ports.json")), g = {
152152
ports: [],
153153
getPorts: function() {
154154
return this.ports;
@@ -199,7 +199,7 @@
199199
});
200200
}
201201
};
202-
d.initPortsFromFile(), e.exports.addPort = o, e.exports.removePort = i, e.exports.getAllPorts = u;
202+
g.initPortsFromFile(), e.exports.addPort = o, e.exports.removePort = i, e.exports.getAllPorts = u;
203203
}, function(e, r) {
204204
e.exports = require("portastic");
205205
}, function(e, r) {
@@ -208,7 +208,7 @@
208208
e.exports = require("unix-dgram");
209209
}, function(e, r, t) {
210210
"use strict";
211-
var n, s, a, o, i, u, c, p, f, l, d, g, m, w, h, b, x, v, k = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
211+
var n, s, a, o, i, u, c, p, f, l, g, d, m, w, h, b, x, v, k = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
212212
return typeof e;
213213
} : function(e) {
214214
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
@@ -705,7 +705,7 @@
705705
}, e, this);
706706
})), function() {
707707
return l.apply(this, arguments);
708-
}), A = (d = W(regeneratorRuntime.mark(function e() {
708+
}), A = (g = W(regeneratorRuntime.mark(function e() {
709709
var r, t, n, s;
710710
return regeneratorRuntime.wrap(function(e) {
711711
for (;;) switch (e.prev = e.next) {
@@ -745,8 +745,8 @@
745745
}
746746
}, e, this);
747747
})), function() {
748-
return d.apply(this, arguments);
749-
}), q = (g = W(regeneratorRuntime.mark(function e() {
748+
return g.apply(this, arguments);
749+
}), q = (d = W(regeneratorRuntime.mark(function e() {
750750
var r, t, n, s, a;
751751
return regeneratorRuntime.wrap(function(e) {
752752
for (;;) switch (e.prev = e.next) {
@@ -779,7 +779,7 @@
779779
}
780780
}, e, this);
781781
})), function() {
782-
return g.apply(this, arguments);
782+
return d.apply(this, arguments);
783783
}), j = (m = W(regeneratorRuntime.mark(function e(r) {
784784
var t, n, s;
785785
return regeneratorRuntime.wrap(function(e) {
@@ -1102,7 +1102,7 @@
11021102
},
11031103
getCommandKeyword: function(e, r) {
11041104
if ("libev" !== e && "python" !== e) throw new Error("illegal argument");
1105-
if ("ping" !== r && "getAllPorts" !== r && "add" !== r && "remove" !== r) throw new Error("illegal argument");
1105+
if ("ping" !== r && "getAllPorts" !== r && "getAllTraffic" !== r && "add" !== r && "remove" !== r) throw new Error("illegal argument");
11061106
return this.commandKeywords[e][r];
11071107
}
11081108
};
@@ -1357,7 +1357,7 @@
13571357
}, e, this, [ [ 0, 7 ] ]);
13581358
})), function(e, r) {
13591359
return o.apply(this, arguments);
1360-
}), d = (i = m(regeneratorRuntime.mark(function e(r, t) {
1360+
}), g = (i = m(regeneratorRuntime.mark(function e(r, t) {
13611361
var n;
13621362
return regeneratorRuntime.wrap(function(e) {
13631363
for (;;) switch (e.prev = e.next) {
@@ -1394,7 +1394,7 @@
13941394
}, e, this, [ [ 0, 7 ] ]);
13951395
})), function(e, r) {
13961396
return i.apply(this, arguments);
1397-
}), g = (u = m(regeneratorRuntime.mark(function e(r, t) {
1397+
}), d = (u = m(regeneratorRuntime.mark(function e(r, t) {
13981398
var n;
13991399
return regeneratorRuntime.wrap(function(e) {
14001400
for (;;) switch (e.prev = e.next) {
@@ -1482,7 +1482,7 @@
14821482
t(3);
14831483
var w = t(10), h = t(5), b = t(4), x = (t(0)("controller"), process.env.LOGIN_PASSWORD), v = b.createHash("sha256").update(x + "W93Ciowi2398(@qi30vmbj02i@WWSoekwoiK").digest("hex");
14841484
e.exports.login = c, e.exports.addPort = p, e.exports.getAllPorts = f, e.exports.getAllTraffic = l,
1485-
e.exports.ping = d, e.exports.removePort = g;
1485+
e.exports.ping = g, e.exports.removePort = d;
14861486
}, function(e, r) {
14871487
e.exports = require("passport-jwt");
14881488
}, function(e, r) {
@@ -1502,11 +1502,11 @@
15021502
}, function(e, r, t) {
15031503
"use strict";
15041504
t(19).config();
1505-
var n = t(18), s = t(1), a = t(17), o = t(16), i = t(15), u = t(14), c = t(4), p = t(13), f = t(12), l = f.Strategy, d = f.ExtractJwt, g = process.env.LOGIN_PASSWORD, m = c.createHash("sha256").update(g + "W93Ciowi2398(@qi30vmbj02i@WWSoekwoiK").digest("hex"), w = void 0;
1505+
var n = t(18), s = t(1), a = t(17), o = t(16), i = t(15), u = t(14), c = t(4), p = t(13), f = t(12), l = f.Strategy, g = f.ExtractJwt, d = process.env.LOGIN_PASSWORD, m = c.createHash("sha256").update(d + "W93Ciowi2398(@qi30vmbj02i@WWSoekwoiK").digest("hex"), w = void 0;
15061506
Number(process.env.LISTEN_PORT) && Number(process.env.LISTEN_PORT) >= 1 && Number(process.env.LISTEN_PORT) <= 65535 ? w = process.env.LISTEN_PORT : (console.warn("LISTEN_PORT invalid. Using 4001."),
15071507
w = 4001);
15081508
var h = {
1509-
jwtFromRequest: d.fromAuthHeaderAsBearerToken(),
1509+
jwtFromRequest: g.fromAuthHeaderAsBearerToken(),
15101510
secretOrKey: m
15111511
};
15121512
p.use(new l(h, function(e, r) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "shadowsocks-restful-api",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "Secure, reliable, standard restful api for managing shadowsocks-libev",
55
"main": "app.js",
66
"scripts": {

0 commit comments

Comments
 (0)