@remnawave/xtls-sdk 0.12.1 → 0.12.3
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/build/src/common/errors/stats/stats.errors.d.ts +4 -0
- package/build/src/common/errors/stats/stats.errors.d.ts.map +1 -1
- package/build/src/common/errors/stats/stats.errors.js +4 -0
- package/build/src/stats/models/get-users-stats/get-users-stats.response.model.d.ts +50 -0
- package/build/src/stats/models/get-users-stats/get-users-stats.response.model.d.ts.map +1 -0
- package/build/src/stats/models/get-users-stats/get-users-stats.response.model.js +52 -0
- package/build/src/stats/models/get-users-stats/index.d.ts +2 -0
- package/build/src/stats/models/get-users-stats/index.d.ts.map +1 -0
- package/build/src/stats/models/get-users-stats/index.js +17 -0
- package/build/src/stats/models/index.d.ts +1 -0
- package/build/src/stats/models/index.d.ts.map +1 -1
- package/build/src/stats/models/index.js +1 -0
- package/build/src/stats/stats.service.d.ts +39 -1
- package/build/src/stats/stats.service.d.ts.map +1 -1
- package/build/src/stats/stats.service.js +119 -0
- package/build/src/xray-protos/app/stats/command/command.d.ts +40 -0
- package/build/src/xray-protos/app/stats/command/command.d.ts.map +1 -1
- package/build/src/xray-protos/app/stats/command/command.js +374 -1
- package/build/src/xray-protos/proxy/vless/account.d.ts +2 -0
- package/build/src/xray-protos/proxy/vless/account.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/vless/account.js +23 -2
- package/build/src/xray-protos/transport/internet/config.d.ts +1 -0
- package/build/src/xray-protos/transport/internet/config.d.ts.map +1 -1
- package/build/src/xray-protos/transport/internet/config.js +44 -24
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.errors.d.ts","sourceRoot":"","sources":["../../../../../src/common/errors/stats/stats.errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;4CAEU,MAAM;;;;kDAIA,MAAM;;;;6CAIX,MAAM;;;;qDAIE,MAAM;;;;qDAIN,MAAM;;;;gDAIX,MAAM;;;;sDAIA,MAAM;;;;iDAIX,MAAM;;;;
|
|
1
|
+
{"version":3,"file":"stats.errors.d.ts","sourceRoot":"","sources":["../../../../../src/common/errors/stats/stats.errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;4CAEU,MAAM;;;;kDAIA,MAAM;;;;6CAIX,MAAM;;;;qDAIE,MAAM;;;;qDAIN,MAAM;;;;gDAIX,MAAM;;;;sDAIA,MAAM;;;;iDAIX,MAAM;;;;8CAIT,MAAM;;;;CAIjC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GetUsersStatsResponse } from '../../../xray-protos/app/stats/command/command';
|
|
2
|
+
export interface UserIPEntry {
|
|
3
|
+
ip: string;
|
|
4
|
+
lastSeen: Date;
|
|
5
|
+
}
|
|
6
|
+
export interface UserTrafficStat {
|
|
7
|
+
uplink: number;
|
|
8
|
+
downlink: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UserStat {
|
|
11
|
+
/**
|
|
12
|
+
* User identifier. Maps to the `email` field from Xray core.
|
|
13
|
+
*/
|
|
14
|
+
id: string;
|
|
15
|
+
ips: UserIPEntry[];
|
|
16
|
+
traffic?: UserTrafficStat;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Model class for handling user statistics response data from the Xray server.
|
|
20
|
+
*/
|
|
21
|
+
export declare class GetUsersStatsResponseModel {
|
|
22
|
+
/**
|
|
23
|
+
* The user statistics data, or null if no data is available.
|
|
24
|
+
*/
|
|
25
|
+
users: UserStat[] | null;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new GetUserStatsResponseModel instance.
|
|
28
|
+
*
|
|
29
|
+
* @param data - The raw query stats response from the Xray server
|
|
30
|
+
*/
|
|
31
|
+
constructor(data: GetUsersStatsResponse);
|
|
32
|
+
/**
|
|
33
|
+
* Creates a model instance from an already-parsed array of user stats,
|
|
34
|
+
* bypassing the native `GetUsersStatsResponse` parser.
|
|
35
|
+
*
|
|
36
|
+
* Intended for code paths that build `UserStat[]` from other sources
|
|
37
|
+
* (e.g. the legacy fallback that combines `GetAllOnlineUsers` and
|
|
38
|
+
* `GetStatsOnlineIpList`).
|
|
39
|
+
*/
|
|
40
|
+
static fromUserStats(users: UserStat[]): GetUsersStatsResponseModel;
|
|
41
|
+
/**
|
|
42
|
+
* Parses the raw stats response data into formatted user statistics.
|
|
43
|
+
*
|
|
44
|
+
* @param data - The raw query stats response to parse
|
|
45
|
+
* @returns An array of formatted user statistics
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
private parseData;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=get-users-stats.response.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-users-stats.response.model.d.ts","sourceRoot":"","sources":["../../../../../src/stats/models/get-users-stats/get-users-stats.response.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAEvF,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,WAAW,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,eAAe,CAAC;CAC7B;AACD;;GAEG;AACH,qBAAa,0BAA0B;IACnC;;OAEG;IACI,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAEhC;;;;OAIG;gBACS,IAAI,EAAE,qBAAqB;IAKvC;;;;;;;OAOG;WACW,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,0BAA0B;IAQ1E;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;CAcpB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetUsersStatsResponseModel = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Model class for handling user statistics response data from the Xray server.
|
|
6
|
+
*/
|
|
7
|
+
class GetUsersStatsResponseModel {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new GetUserStatsResponseModel instance.
|
|
10
|
+
*
|
|
11
|
+
* @param data - The raw query stats response from the Xray server
|
|
12
|
+
*/
|
|
13
|
+
constructor(data) {
|
|
14
|
+
const users = this.parseData(data);
|
|
15
|
+
this.users = users;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates a model instance from an already-parsed array of user stats,
|
|
19
|
+
* bypassing the native `GetUsersStatsResponse` parser.
|
|
20
|
+
*
|
|
21
|
+
* Intended for code paths that build `UserStat[]` from other sources
|
|
22
|
+
* (e.g. the legacy fallback that combines `GetAllOnlineUsers` and
|
|
23
|
+
* `GetStatsOnlineIpList`).
|
|
24
|
+
*/
|
|
25
|
+
static fromUserStats(users) {
|
|
26
|
+
const model = Object.create(GetUsersStatsResponseModel.prototype);
|
|
27
|
+
model.users = users;
|
|
28
|
+
return model;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parses the raw stats response data into formatted user statistics.
|
|
32
|
+
*
|
|
33
|
+
* @param data - The raw query stats response to parse
|
|
34
|
+
* @returns An array of formatted user statistics
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
parseData(data) {
|
|
38
|
+
const users = [];
|
|
39
|
+
for (const user of data.users) {
|
|
40
|
+
const userStat = {
|
|
41
|
+
id: user.email,
|
|
42
|
+
ips: user.ips.map((ip) => ({ ip: ip.ip, lastSeen: new Date(ip.lastSeen * 1000) })),
|
|
43
|
+
traffic: user.traffic
|
|
44
|
+
? { uplink: user.traffic.uplink, downlink: user.traffic.downlink }
|
|
45
|
+
: undefined,
|
|
46
|
+
};
|
|
47
|
+
users.push(userStat);
|
|
48
|
+
}
|
|
49
|
+
return users;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.GetUsersStatsResponseModel = GetUsersStatsResponseModel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/stats/models/get-users-stats/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-users-stats.response.model"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/stats/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/stats/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
|
@@ -22,3 +22,4 @@ __exportStar(require("./get-all-inbounds-stats"), exports);
|
|
|
22
22
|
__exportStar(require("./get-inbound-stats"), exports);
|
|
23
23
|
__exportStar(require("./get-all-outbounds-stats"), exports);
|
|
24
24
|
__exportStar(require("./get-outbound-stats"), exports);
|
|
25
|
+
__exportStar(require("./get-users-stats"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Channel } from 'nice-grpc';
|
|
2
|
-
import { GetAllUsersStatsResponseModel, GetUserStatsResponseModel, GetSysStatsResponseModel, GetUserOnlineStatusResponseModel, GetAllInboundsStatsResponseModel, GetInboundStatsResponseModel, GetAllOutboundsStatsResponseModel, GetOutboundStatsResponseModel } from './models';
|
|
2
|
+
import { GetAllUsersStatsResponseModel, GetUserStatsResponseModel, GetSysStatsResponseModel, GetUserOnlineStatusResponseModel, GetAllInboundsStatsResponseModel, GetInboundStatsResponseModel, GetAllOutboundsStatsResponseModel, GetOutboundStatsResponseModel, GetUsersStatsResponseModel } from './models';
|
|
3
3
|
import { StatsServiceClient } from '../xray-protos/app/stats/command/command';
|
|
4
4
|
import { ISdkResponse } from '../common/types';
|
|
5
5
|
/**
|
|
@@ -31,6 +31,17 @@ export declare class StatsService {
|
|
|
31
31
|
* @private
|
|
32
32
|
*/
|
|
33
33
|
private readonly client;
|
|
34
|
+
/**
|
|
35
|
+
* Cached flag indicating whether the remote Xray server supports the
|
|
36
|
+
* `GetUsersStats` unary method. `null` means "not probed yet", `true` means
|
|
37
|
+
* the method is available, `false` means the legacy fallback should be used.
|
|
38
|
+
*
|
|
39
|
+
* The flag is cached for the lifetime of this instance — if the Xray core
|
|
40
|
+
* is upgraded without re-creating the SDK, a manual re-instantiation is
|
|
41
|
+
* required to re-detect support.
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
private supportsGetUsersStats;
|
|
34
45
|
/**
|
|
35
46
|
* Creates a new StatsService instance
|
|
36
47
|
* @param channel - The gRPC channel to use for communication with the Xray server
|
|
@@ -224,6 +235,33 @@ export declare class StatsService {
|
|
|
224
235
|
* ```
|
|
225
236
|
*/
|
|
226
237
|
getOutboundStats(outbound: string, reset?: boolean): Promise<ISdkResponse<GetOutboundStatsResponseModel>>;
|
|
238
|
+
/**
|
|
239
|
+
* Retrieves per-user statistics (online IP list and, optionally, traffic)
|
|
240
|
+
* from the Xray server.
|
|
241
|
+
*
|
|
242
|
+
* Prefers the native `GetUsersStats` gRPC method introduced in recent
|
|
243
|
+
* Xray-core versions. If the server replies with `UNIMPLEMENTED` (i.e. the
|
|
244
|
+
* method is missing), transparently falls back to the legacy approach of
|
|
245
|
+
* combining `GetAllOnlineUsers` + `GetStatsOnlineIpList`. The detection
|
|
246
|
+
* result is cached for the lifetime of this service instance, so the
|
|
247
|
+
* `UNIMPLEMENTED` round-trip happens at most once.
|
|
248
|
+
*
|
|
249
|
+
* Note: the `includeTraffic` flag is honored only on the native path. In
|
|
250
|
+
* legacy mode traffic is always returned as `undefined`, since the old
|
|
251
|
+
* endpoints do not expose per-user traffic in a single call.
|
|
252
|
+
*
|
|
253
|
+
* @param includeTraffic - Whether to request traffic counters alongside IPs (native path only).
|
|
254
|
+
* @param reset - Whether to reset the stats after retrieving them.
|
|
255
|
+
*/
|
|
256
|
+
getUsersStats(includeTraffic?: boolean, reset?: boolean): Promise<ISdkResponse<GetUsersStatsResponseModel>>;
|
|
257
|
+
/**
|
|
258
|
+
* Legacy fallback for {@link getUsersStats}. Uses `GetAllOnlineUsers` to
|
|
259
|
+
* enumerate currently connected users and then queries
|
|
260
|
+
* `GetStatsOnlineIpList` for each of them in parallel with a bounded
|
|
261
|
+
* worker pool. Always returns `traffic: undefined` for every user.
|
|
262
|
+
* @private
|
|
263
|
+
*/
|
|
264
|
+
private getUsersStatsLegacy;
|
|
227
265
|
/**
|
|
228
266
|
* Gets the raw gRPC client for direct access to all stats service methods
|
|
229
267
|
* @returns The underlying StatsServiceClient instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.service.d.ts","sourceRoot":"","sources":["../../../src/stats/stats.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"stats.service.d.ts","sourceRoot":"","sources":["../../../src/stats/stats.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqC,MAAM,WAAW,CAAC;AAEvE,OAAO,EACH,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,EAC5B,iCAAiC,EACjC,6BAA6B,EAC7B,0BAA0B,EAE7B,MAAM,UAAU,CAAC;AAClB,OAAO,EAEH,kBAAkB,EACrB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,YAAY;IAuBT,OAAO,CAAC,QAAQ,CAAC,OAAO;IAtBpC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C;;;;;;;;;OASG;IACH,OAAO,CAAC,qBAAqB,CAAwB;IAErD;;;OAGG;gBAC0B,OAAO,EAAE,OAAO;IAI7C;;;;;;;;;;;;;;;;;;;OAmBG;IACU,WAAW,IAAI,OAAO,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;IAoB3E;;;;;;;;;;;;;;;;;;;;;;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
|
|
35
35
|
constructor(channel) {
|
|
36
36
|
this.channel = channel;
|
|
37
|
+
/**
|
|
38
|
+
* Cached flag indicating whether the remote Xray server supports the
|
|
39
|
+
* `GetUsersStats` unary method. `null` means "not probed yet", `true` means
|
|
40
|
+
* the method is available, `false` means the legacy fallback should be used.
|
|
41
|
+
*
|
|
42
|
+
* The flag is cached for the lifetime of this instance — if the Xray core
|
|
43
|
+
* is upgraded without re-creating the SDK, a manual re-instantiation is
|
|
44
|
+
* required to re-detect support.
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
this.supportsGetUsersStats = null;
|
|
37
48
|
this.client = (0, nice_grpc_1.createClient)(command_1.StatsServiceDefinition, channel);
|
|
38
49
|
}
|
|
39
50
|
/**
|
|
@@ -395,6 +406,114 @@ class StatsService {
|
|
|
395
406
|
};
|
|
396
407
|
}
|
|
397
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Retrieves per-user statistics (online IP list and, optionally, traffic)
|
|
411
|
+
* from the Xray server.
|
|
412
|
+
*
|
|
413
|
+
* Prefers the native `GetUsersStats` gRPC method introduced in recent
|
|
414
|
+
* Xray-core versions. If the server replies with `UNIMPLEMENTED` (i.e. the
|
|
415
|
+
* method is missing), transparently falls back to the legacy approach of
|
|
416
|
+
* combining `GetAllOnlineUsers` + `GetStatsOnlineIpList`. The detection
|
|
417
|
+
* result is cached for the lifetime of this service instance, so the
|
|
418
|
+
* `UNIMPLEMENTED` round-trip happens at most once.
|
|
419
|
+
*
|
|
420
|
+
* Note: the `includeTraffic` flag is honored only on the native path. In
|
|
421
|
+
* legacy mode traffic is always returned as `undefined`, since the old
|
|
422
|
+
* endpoints do not expose per-user traffic in a single call.
|
|
423
|
+
*
|
|
424
|
+
* @param includeTraffic - Whether to request traffic counters alongside IPs (native path only).
|
|
425
|
+
* @param reset - Whether to reset the stats after retrieving them.
|
|
426
|
+
*/
|
|
427
|
+
async getUsersStats(includeTraffic = false, reset = false) {
|
|
428
|
+
if (this.supportsGetUsersStats === false) {
|
|
429
|
+
return this.getUsersStatsLegacy(reset);
|
|
430
|
+
}
|
|
431
|
+
try {
|
|
432
|
+
const response = await this.client.getUsersStats({
|
|
433
|
+
includeTraffic,
|
|
434
|
+
reset,
|
|
435
|
+
});
|
|
436
|
+
this.supportsGetUsersStats = true;
|
|
437
|
+
return {
|
|
438
|
+
isOk: true,
|
|
439
|
+
data: new models_1.GetUsersStatsResponseModel(response),
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
catch (error) {
|
|
443
|
+
if (error instanceof nice_grpc_1.ClientError && error.code === nice_grpc_1.Status.UNIMPLEMENTED) {
|
|
444
|
+
this.supportsGetUsersStats = false;
|
|
445
|
+
return this.getUsersStatsLegacy(reset);
|
|
446
|
+
}
|
|
447
|
+
let message = '';
|
|
448
|
+
if (error instanceof Error) {
|
|
449
|
+
message = error.message;
|
|
450
|
+
}
|
|
451
|
+
return {
|
|
452
|
+
isOk: false,
|
|
453
|
+
...errors_1.STATS_ERRORS.GET_USERS_STATS_ERROR(message),
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Legacy fallback for {@link getUsersStats}. Uses `GetAllOnlineUsers` to
|
|
459
|
+
* enumerate currently connected users and then queries
|
|
460
|
+
* `GetStatsOnlineIpList` for each of them in parallel with a bounded
|
|
461
|
+
* worker pool. Always returns `traffic: undefined` for every user.
|
|
462
|
+
* @private
|
|
463
|
+
*/
|
|
464
|
+
async getUsersStatsLegacy(reset) {
|
|
465
|
+
try {
|
|
466
|
+
const { users: onlineUsers } = await this.client.getAllOnlineUsers({});
|
|
467
|
+
// De-duplicate, just in case Xray ever returns the same email twice.
|
|
468
|
+
const uniqueEmails = Array.from(new Set(onlineUsers));
|
|
469
|
+
const results = new Array(uniqueEmails.length);
|
|
470
|
+
const concurrency = Math.min(50, uniqueEmails.length);
|
|
471
|
+
let cursor = 0;
|
|
472
|
+
const worker = async () => {
|
|
473
|
+
while (true) {
|
|
474
|
+
const index = cursor++;
|
|
475
|
+
if (index >= uniqueEmails.length)
|
|
476
|
+
return;
|
|
477
|
+
const email = uniqueEmails[index];
|
|
478
|
+
let ips = [];
|
|
479
|
+
try {
|
|
480
|
+
const ipListResponse = await this.client.getStatsOnlineIpList({
|
|
481
|
+
name: `user>>>${email}>>>online`,
|
|
482
|
+
reset,
|
|
483
|
+
});
|
|
484
|
+
ips = Object.entries(ipListResponse.ips).map(([ip, lastSeen]) => ({
|
|
485
|
+
ip,
|
|
486
|
+
lastSeen: new Date(lastSeen * 1000),
|
|
487
|
+
}));
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
// Per-user failure is non-fatal: fall through with empty ips.
|
|
491
|
+
}
|
|
492
|
+
results[index] = { id: email, ips, traffic: undefined };
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
const workers = [];
|
|
496
|
+
for (let i = 0; i < concurrency; i++) {
|
|
497
|
+
workers.push(worker());
|
|
498
|
+
}
|
|
499
|
+
await Promise.all(workers);
|
|
500
|
+
const filtered = results.filter((user) => user.ips.length > 0);
|
|
501
|
+
return {
|
|
502
|
+
isOk: true,
|
|
503
|
+
data: models_1.GetUsersStatsResponseModel.fromUserStats(filtered),
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
let message = '';
|
|
508
|
+
if (error instanceof Error) {
|
|
509
|
+
message = error.message;
|
|
510
|
+
}
|
|
511
|
+
return {
|
|
512
|
+
isOk: false,
|
|
513
|
+
...errors_1.STATS_ERRORS.GET_USERS_STATS_ERROR(message),
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
}
|
|
398
517
|
/**
|
|
399
518
|
* Gets the raw gRPC client for direct access to all stats service methods
|
|
400
519
|
* @returns The underlying StatsServiceClient instance
|
|
@@ -61,6 +61,31 @@ export interface GetAllOnlineUsersResponse {
|
|
|
61
61
|
$type: "xray.app.stats.command.GetAllOnlineUsersResponse";
|
|
62
62
|
users: string[];
|
|
63
63
|
}
|
|
64
|
+
export interface OnlineIPEntry {
|
|
65
|
+
$type: "xray.app.stats.command.OnlineIPEntry";
|
|
66
|
+
ip: string;
|
|
67
|
+
lastSeen: number;
|
|
68
|
+
}
|
|
69
|
+
export interface TrafficUserStat {
|
|
70
|
+
$type: "xray.app.stats.command.TrafficUserStat";
|
|
71
|
+
uplink: number;
|
|
72
|
+
downlink: number;
|
|
73
|
+
}
|
|
74
|
+
export interface UserStat {
|
|
75
|
+
$type: "xray.app.stats.command.UserStat";
|
|
76
|
+
email: string;
|
|
77
|
+
ips: OnlineIPEntry[];
|
|
78
|
+
traffic: TrafficUserStat | undefined;
|
|
79
|
+
}
|
|
80
|
+
export interface GetUsersStatsRequest {
|
|
81
|
+
$type: "xray.app.stats.command.GetUsersStatsRequest";
|
|
82
|
+
includeTraffic: boolean;
|
|
83
|
+
reset: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface GetUsersStatsResponse {
|
|
86
|
+
$type: "xray.app.stats.command.GetUsersStatsResponse";
|
|
87
|
+
users: UserStat[];
|
|
88
|
+
}
|
|
64
89
|
export interface Config {
|
|
65
90
|
$type: "xray.app.stats.command.Config";
|
|
66
91
|
}
|
|
@@ -75,6 +100,11 @@ export declare const GetStatsOnlineIpListResponse: MessageFns<GetStatsOnlineIpLi
|
|
|
75
100
|
export declare const GetStatsOnlineIpListResponse_IpsEntry: MessageFns<GetStatsOnlineIpListResponse_IpsEntry, "xray.app.stats.command.GetStatsOnlineIpListResponse.IpsEntry">;
|
|
76
101
|
export declare const GetAllOnlineUsersRequest: MessageFns<GetAllOnlineUsersRequest, "xray.app.stats.command.GetAllOnlineUsersRequest">;
|
|
77
102
|
export declare const GetAllOnlineUsersResponse: MessageFns<GetAllOnlineUsersResponse, "xray.app.stats.command.GetAllOnlineUsersResponse">;
|
|
103
|
+
export declare const OnlineIPEntry: MessageFns<OnlineIPEntry, "xray.app.stats.command.OnlineIPEntry">;
|
|
104
|
+
export declare const TrafficUserStat: MessageFns<TrafficUserStat, "xray.app.stats.command.TrafficUserStat">;
|
|
105
|
+
export declare const UserStat: MessageFns<UserStat, "xray.app.stats.command.UserStat">;
|
|
106
|
+
export declare const GetUsersStatsRequest: MessageFns<GetUsersStatsRequest, "xray.app.stats.command.GetUsersStatsRequest">;
|
|
107
|
+
export declare const GetUsersStatsResponse: MessageFns<GetUsersStatsResponse, "xray.app.stats.command.GetUsersStatsResponse">;
|
|
78
108
|
export declare const Config: MessageFns<Config, "xray.app.stats.command.Config">;
|
|
79
109
|
export type StatsServiceDefinition = typeof StatsServiceDefinition;
|
|
80
110
|
export declare const StatsServiceDefinition: {
|
|
@@ -129,6 +159,14 @@ export declare const StatsServiceDefinition: {
|
|
|
129
159
|
readonly responseStream: false;
|
|
130
160
|
readonly options: {};
|
|
131
161
|
};
|
|
162
|
+
readonly getUsersStats: {
|
|
163
|
+
readonly name: "GetUsersStats";
|
|
164
|
+
readonly requestType: MessageFns<GetUsersStatsRequest, "xray.app.stats.command.GetUsersStatsRequest">;
|
|
165
|
+
readonly requestStream: false;
|
|
166
|
+
readonly responseType: MessageFns<GetUsersStatsResponse, "xray.app.stats.command.GetUsersStatsResponse">;
|
|
167
|
+
readonly responseStream: false;
|
|
168
|
+
readonly options: {};
|
|
169
|
+
};
|
|
132
170
|
};
|
|
133
171
|
};
|
|
134
172
|
export interface StatsServiceImplementation<CallContextExt = {}> {
|
|
@@ -138,6 +176,7 @@ export interface StatsServiceImplementation<CallContextExt = {}> {
|
|
|
138
176
|
getSysStats(request: SysStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<SysStatsResponse>>;
|
|
139
177
|
getStatsOnlineIpList(request: GetStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetStatsOnlineIpListResponse>>;
|
|
140
178
|
getAllOnlineUsers(request: GetAllOnlineUsersRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetAllOnlineUsersResponse>>;
|
|
179
|
+
getUsersStats(request: GetUsersStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetUsersStatsResponse>>;
|
|
141
180
|
}
|
|
142
181
|
export interface StatsServiceClient<CallOptionsExt = {}> {
|
|
143
182
|
getStats(request: DeepPartial<GetStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetStatsResponse>;
|
|
@@ -146,6 +185,7 @@ export interface StatsServiceClient<CallOptionsExt = {}> {
|
|
|
146
185
|
getSysStats(request: DeepPartial<SysStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<SysStatsResponse>;
|
|
147
186
|
getStatsOnlineIpList(request: DeepPartial<GetStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetStatsOnlineIpListResponse>;
|
|
148
187
|
getAllOnlineUsers(request: DeepPartial<GetAllOnlineUsersRequest>, options?: CallOptions & CallOptionsExt): Promise<GetAllOnlineUsersResponse>;
|
|
188
|
+
getUsersStats(request: DeepPartial<GetUsersStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetUsersStatsResponse>;
|
|
149
189
|
}
|
|
150
190
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
151
191
|
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/app/stats/command/command.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGjE,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,wCAAwC,CAAC;IAChD,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,K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BAAsB
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/app/stats/command/command.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGjE,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,wCAAwC,CAAC;IAChD,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,6BAA6B,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,yCAAyC,CAAC;IACjD,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,0CAA0C,CAAC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,2CAA2C,CAAC;IACnD,IAAI,EAAE,IAAI,EAAE,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,wCAAwC,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,yCAAyC,CAAC;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;I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GAC9C,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACvE,OAAO,CAAC,CAAC,CAAC,CAAC;AAqBf,MAAM,WAAW,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM;IAC7C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: app/stats/command/command.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.StatsServiceDefinition = exports.Config = exports.GetAllOnlineUsersResponse = exports.GetAllOnlineUsersRequest = exports.GetStatsOnlineIpListResponse_IpsEntry = exports.GetStatsOnlineIpListResponse = exports.SysStatsResponse = exports.SysStatsRequest = exports.QueryStatsResponse = exports.QueryStatsRequest = exports.GetStatsResponse = exports.Stat = exports.GetStatsRequest = exports.protobufPackage = void 0;
|
|
8
|
+
exports.StatsServiceDefinition = exports.Config = exports.GetUsersStatsResponse = exports.GetUsersStatsRequest = exports.UserStat = exports.TrafficUserStat = exports.OnlineIPEntry = exports.GetAllOnlineUsersResponse = exports.GetAllOnlineUsersRequest = exports.GetStatsOnlineIpListResponse_IpsEntry = exports.GetStatsOnlineIpListResponse = exports.SysStatsResponse = exports.SysStatsRequest = exports.QueryStatsResponse = exports.QueryStatsRequest = exports.GetStatsResponse = exports.Stat = exports.GetStatsRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const typeRegistry_1 = require("../../../typeRegistry");
|
|
@@ -834,6 +834,371 @@ exports.GetAllOnlineUsersResponse = {
|
|
|
834
834
|
},
|
|
835
835
|
};
|
|
836
836
|
typeRegistry_1.messageTypeRegistry.set(exports.GetAllOnlineUsersResponse.$type, exports.GetAllOnlineUsersResponse);
|
|
837
|
+
function createBaseOnlineIPEntry() {
|
|
838
|
+
return { $type: "xray.app.stats.command.OnlineIPEntry", ip: "", lastSeen: 0 };
|
|
839
|
+
}
|
|
840
|
+
exports.OnlineIPEntry = {
|
|
841
|
+
$type: "xray.app.stats.command.OnlineIPEntry",
|
|
842
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
843
|
+
if (message.ip !== "") {
|
|
844
|
+
writer.uint32(10).string(message.ip);
|
|
845
|
+
}
|
|
846
|
+
if (message.lastSeen !== 0) {
|
|
847
|
+
writer.uint32(16).int64(message.lastSeen);
|
|
848
|
+
}
|
|
849
|
+
return writer;
|
|
850
|
+
},
|
|
851
|
+
decode(input, length) {
|
|
852
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
853
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
854
|
+
const message = createBaseOnlineIPEntry();
|
|
855
|
+
while (reader.pos < end) {
|
|
856
|
+
const tag = reader.uint32();
|
|
857
|
+
switch (tag >>> 3) {
|
|
858
|
+
case 1: {
|
|
859
|
+
if (tag !== 10) {
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
message.ip = reader.string();
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
case 2: {
|
|
866
|
+
if (tag !== 16) {
|
|
867
|
+
break;
|
|
868
|
+
}
|
|
869
|
+
message.lastSeen = longToNumber(reader.int64());
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
reader.skip(tag & 7);
|
|
877
|
+
}
|
|
878
|
+
return message;
|
|
879
|
+
},
|
|
880
|
+
fromJSON(object) {
|
|
881
|
+
return {
|
|
882
|
+
$type: exports.OnlineIPEntry.$type,
|
|
883
|
+
ip: isSet(object.ip) ? globalThis.String(object.ip) : "",
|
|
884
|
+
lastSeen: isSet(object.lastSeen)
|
|
885
|
+
? globalThis.Number(object.lastSeen)
|
|
886
|
+
: isSet(object.last_seen)
|
|
887
|
+
? globalThis.Number(object.last_seen)
|
|
888
|
+
: 0,
|
|
889
|
+
};
|
|
890
|
+
},
|
|
891
|
+
toJSON(message) {
|
|
892
|
+
const obj = {};
|
|
893
|
+
if (message.ip !== "") {
|
|
894
|
+
obj.ip = message.ip;
|
|
895
|
+
}
|
|
896
|
+
if (message.lastSeen !== 0) {
|
|
897
|
+
obj.lastSeen = Math.round(message.lastSeen);
|
|
898
|
+
}
|
|
899
|
+
return obj;
|
|
900
|
+
},
|
|
901
|
+
create(base) {
|
|
902
|
+
return exports.OnlineIPEntry.fromPartial(base ?? {});
|
|
903
|
+
},
|
|
904
|
+
fromPartial(object) {
|
|
905
|
+
const message = createBaseOnlineIPEntry();
|
|
906
|
+
message.ip = object.ip ?? "";
|
|
907
|
+
message.lastSeen = object.lastSeen ?? 0;
|
|
908
|
+
return message;
|
|
909
|
+
},
|
|
910
|
+
};
|
|
911
|
+
typeRegistry_1.messageTypeRegistry.set(exports.OnlineIPEntry.$type, exports.OnlineIPEntry);
|
|
912
|
+
function createBaseTrafficUserStat() {
|
|
913
|
+
return { $type: "xray.app.stats.command.TrafficUserStat", uplink: 0, downlink: 0 };
|
|
914
|
+
}
|
|
915
|
+
exports.TrafficUserStat = {
|
|
916
|
+
$type: "xray.app.stats.command.TrafficUserStat",
|
|
917
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
918
|
+
if (message.uplink !== 0) {
|
|
919
|
+
writer.uint32(8).int64(message.uplink);
|
|
920
|
+
}
|
|
921
|
+
if (message.downlink !== 0) {
|
|
922
|
+
writer.uint32(16).int64(message.downlink);
|
|
923
|
+
}
|
|
924
|
+
return writer;
|
|
925
|
+
},
|
|
926
|
+
decode(input, length) {
|
|
927
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
928
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
929
|
+
const message = createBaseTrafficUserStat();
|
|
930
|
+
while (reader.pos < end) {
|
|
931
|
+
const tag = reader.uint32();
|
|
932
|
+
switch (tag >>> 3) {
|
|
933
|
+
case 1: {
|
|
934
|
+
if (tag !== 8) {
|
|
935
|
+
break;
|
|
936
|
+
}
|
|
937
|
+
message.uplink = longToNumber(reader.int64());
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
case 2: {
|
|
941
|
+
if (tag !== 16) {
|
|
942
|
+
break;
|
|
943
|
+
}
|
|
944
|
+
message.downlink = longToNumber(reader.int64());
|
|
945
|
+
continue;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
reader.skip(tag & 7);
|
|
952
|
+
}
|
|
953
|
+
return message;
|
|
954
|
+
},
|
|
955
|
+
fromJSON(object) {
|
|
956
|
+
return {
|
|
957
|
+
$type: exports.TrafficUserStat.$type,
|
|
958
|
+
uplink: isSet(object.uplink) ? globalThis.Number(object.uplink) : 0,
|
|
959
|
+
downlink: isSet(object.downlink) ? globalThis.Number(object.downlink) : 0,
|
|
960
|
+
};
|
|
961
|
+
},
|
|
962
|
+
toJSON(message) {
|
|
963
|
+
const obj = {};
|
|
964
|
+
if (message.uplink !== 0) {
|
|
965
|
+
obj.uplink = Math.round(message.uplink);
|
|
966
|
+
}
|
|
967
|
+
if (message.downlink !== 0) {
|
|
968
|
+
obj.downlink = Math.round(message.downlink);
|
|
969
|
+
}
|
|
970
|
+
return obj;
|
|
971
|
+
},
|
|
972
|
+
create(base) {
|
|
973
|
+
return exports.TrafficUserStat.fromPartial(base ?? {});
|
|
974
|
+
},
|
|
975
|
+
fromPartial(object) {
|
|
976
|
+
const message = createBaseTrafficUserStat();
|
|
977
|
+
message.uplink = object.uplink ?? 0;
|
|
978
|
+
message.downlink = object.downlink ?? 0;
|
|
979
|
+
return message;
|
|
980
|
+
},
|
|
981
|
+
};
|
|
982
|
+
typeRegistry_1.messageTypeRegistry.set(exports.TrafficUserStat.$type, exports.TrafficUserStat);
|
|
983
|
+
function createBaseUserStat() {
|
|
984
|
+
return { $type: "xray.app.stats.command.UserStat", email: "", ips: [], traffic: undefined };
|
|
985
|
+
}
|
|
986
|
+
exports.UserStat = {
|
|
987
|
+
$type: "xray.app.stats.command.UserStat",
|
|
988
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
989
|
+
if (message.email !== "") {
|
|
990
|
+
writer.uint32(10).string(message.email);
|
|
991
|
+
}
|
|
992
|
+
for (const v of message.ips) {
|
|
993
|
+
exports.OnlineIPEntry.encode(v, writer.uint32(18).fork()).join();
|
|
994
|
+
}
|
|
995
|
+
if (message.traffic !== undefined) {
|
|
996
|
+
exports.TrafficUserStat.encode(message.traffic, writer.uint32(26).fork()).join();
|
|
997
|
+
}
|
|
998
|
+
return writer;
|
|
999
|
+
},
|
|
1000
|
+
decode(input, length) {
|
|
1001
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1002
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1003
|
+
const message = createBaseUserStat();
|
|
1004
|
+
while (reader.pos < end) {
|
|
1005
|
+
const tag = reader.uint32();
|
|
1006
|
+
switch (tag >>> 3) {
|
|
1007
|
+
case 1: {
|
|
1008
|
+
if (tag !== 10) {
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
message.email = reader.string();
|
|
1012
|
+
continue;
|
|
1013
|
+
}
|
|
1014
|
+
case 2: {
|
|
1015
|
+
if (tag !== 18) {
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
message.ips.push(exports.OnlineIPEntry.decode(reader, reader.uint32()));
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
case 3: {
|
|
1022
|
+
if (tag !== 26) {
|
|
1023
|
+
break;
|
|
1024
|
+
}
|
|
1025
|
+
message.traffic = exports.TrafficUserStat.decode(reader, reader.uint32());
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
reader.skip(tag & 7);
|
|
1033
|
+
}
|
|
1034
|
+
return message;
|
|
1035
|
+
},
|
|
1036
|
+
fromJSON(object) {
|
|
1037
|
+
return {
|
|
1038
|
+
$type: exports.UserStat.$type,
|
|
1039
|
+
email: isSet(object.email) ? globalThis.String(object.email) : "",
|
|
1040
|
+
ips: globalThis.Array.isArray(object?.ips) ? object.ips.map((e) => exports.OnlineIPEntry.fromJSON(e)) : [],
|
|
1041
|
+
traffic: isSet(object.traffic) ? exports.TrafficUserStat.fromJSON(object.traffic) : undefined,
|
|
1042
|
+
};
|
|
1043
|
+
},
|
|
1044
|
+
toJSON(message) {
|
|
1045
|
+
const obj = {};
|
|
1046
|
+
if (message.email !== "") {
|
|
1047
|
+
obj.email = message.email;
|
|
1048
|
+
}
|
|
1049
|
+
if (message.ips?.length) {
|
|
1050
|
+
obj.ips = message.ips.map((e) => exports.OnlineIPEntry.toJSON(e));
|
|
1051
|
+
}
|
|
1052
|
+
if (message.traffic !== undefined) {
|
|
1053
|
+
obj.traffic = exports.TrafficUserStat.toJSON(message.traffic);
|
|
1054
|
+
}
|
|
1055
|
+
return obj;
|
|
1056
|
+
},
|
|
1057
|
+
create(base) {
|
|
1058
|
+
return exports.UserStat.fromPartial(base ?? {});
|
|
1059
|
+
},
|
|
1060
|
+
fromPartial(object) {
|
|
1061
|
+
const message = createBaseUserStat();
|
|
1062
|
+
message.email = object.email ?? "";
|
|
1063
|
+
message.ips = object.ips?.map((e) => exports.OnlineIPEntry.fromPartial(e)) || [];
|
|
1064
|
+
message.traffic = (object.traffic !== undefined && object.traffic !== null)
|
|
1065
|
+
? exports.TrafficUserStat.fromPartial(object.traffic)
|
|
1066
|
+
: undefined;
|
|
1067
|
+
return message;
|
|
1068
|
+
},
|
|
1069
|
+
};
|
|
1070
|
+
typeRegistry_1.messageTypeRegistry.set(exports.UserStat.$type, exports.UserStat);
|
|
1071
|
+
function createBaseGetUsersStatsRequest() {
|
|
1072
|
+
return { $type: "xray.app.stats.command.GetUsersStatsRequest", includeTraffic: false, reset: false };
|
|
1073
|
+
}
|
|
1074
|
+
exports.GetUsersStatsRequest = {
|
|
1075
|
+
$type: "xray.app.stats.command.GetUsersStatsRequest",
|
|
1076
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1077
|
+
if (message.includeTraffic !== false) {
|
|
1078
|
+
writer.uint32(8).bool(message.includeTraffic);
|
|
1079
|
+
}
|
|
1080
|
+
if (message.reset !== false) {
|
|
1081
|
+
writer.uint32(16).bool(message.reset);
|
|
1082
|
+
}
|
|
1083
|
+
return writer;
|
|
1084
|
+
},
|
|
1085
|
+
decode(input, length) {
|
|
1086
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1087
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1088
|
+
const message = createBaseGetUsersStatsRequest();
|
|
1089
|
+
while (reader.pos < end) {
|
|
1090
|
+
const tag = reader.uint32();
|
|
1091
|
+
switch (tag >>> 3) {
|
|
1092
|
+
case 1: {
|
|
1093
|
+
if (tag !== 8) {
|
|
1094
|
+
break;
|
|
1095
|
+
}
|
|
1096
|
+
message.includeTraffic = reader.bool();
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
case 2: {
|
|
1100
|
+
if (tag !== 16) {
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
message.reset = reader.bool();
|
|
1104
|
+
continue;
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1108
|
+
break;
|
|
1109
|
+
}
|
|
1110
|
+
reader.skip(tag & 7);
|
|
1111
|
+
}
|
|
1112
|
+
return message;
|
|
1113
|
+
},
|
|
1114
|
+
fromJSON(object) {
|
|
1115
|
+
return {
|
|
1116
|
+
$type: exports.GetUsersStatsRequest.$type,
|
|
1117
|
+
includeTraffic: isSet(object.includeTraffic)
|
|
1118
|
+
? globalThis.Boolean(object.includeTraffic)
|
|
1119
|
+
: isSet(object.include_traffic)
|
|
1120
|
+
? globalThis.Boolean(object.include_traffic)
|
|
1121
|
+
: false,
|
|
1122
|
+
reset: isSet(object.reset) ? globalThis.Boolean(object.reset) : false,
|
|
1123
|
+
};
|
|
1124
|
+
},
|
|
1125
|
+
toJSON(message) {
|
|
1126
|
+
const obj = {};
|
|
1127
|
+
if (message.includeTraffic !== false) {
|
|
1128
|
+
obj.includeTraffic = message.includeTraffic;
|
|
1129
|
+
}
|
|
1130
|
+
if (message.reset !== false) {
|
|
1131
|
+
obj.reset = message.reset;
|
|
1132
|
+
}
|
|
1133
|
+
return obj;
|
|
1134
|
+
},
|
|
1135
|
+
create(base) {
|
|
1136
|
+
return exports.GetUsersStatsRequest.fromPartial(base ?? {});
|
|
1137
|
+
},
|
|
1138
|
+
fromPartial(object) {
|
|
1139
|
+
const message = createBaseGetUsersStatsRequest();
|
|
1140
|
+
message.includeTraffic = object.includeTraffic ?? false;
|
|
1141
|
+
message.reset = object.reset ?? false;
|
|
1142
|
+
return message;
|
|
1143
|
+
},
|
|
1144
|
+
};
|
|
1145
|
+
typeRegistry_1.messageTypeRegistry.set(exports.GetUsersStatsRequest.$type, exports.GetUsersStatsRequest);
|
|
1146
|
+
function createBaseGetUsersStatsResponse() {
|
|
1147
|
+
return { $type: "xray.app.stats.command.GetUsersStatsResponse", users: [] };
|
|
1148
|
+
}
|
|
1149
|
+
exports.GetUsersStatsResponse = {
|
|
1150
|
+
$type: "xray.app.stats.command.GetUsersStatsResponse",
|
|
1151
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1152
|
+
for (const v of message.users) {
|
|
1153
|
+
exports.UserStat.encode(v, writer.uint32(10).fork()).join();
|
|
1154
|
+
}
|
|
1155
|
+
return writer;
|
|
1156
|
+
},
|
|
1157
|
+
decode(input, length) {
|
|
1158
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1159
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1160
|
+
const message = createBaseGetUsersStatsResponse();
|
|
1161
|
+
while (reader.pos < end) {
|
|
1162
|
+
const tag = reader.uint32();
|
|
1163
|
+
switch (tag >>> 3) {
|
|
1164
|
+
case 1: {
|
|
1165
|
+
if (tag !== 10) {
|
|
1166
|
+
break;
|
|
1167
|
+
}
|
|
1168
|
+
message.users.push(exports.UserStat.decode(reader, reader.uint32()));
|
|
1169
|
+
continue;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1173
|
+
break;
|
|
1174
|
+
}
|
|
1175
|
+
reader.skip(tag & 7);
|
|
1176
|
+
}
|
|
1177
|
+
return message;
|
|
1178
|
+
},
|
|
1179
|
+
fromJSON(object) {
|
|
1180
|
+
return {
|
|
1181
|
+
$type: exports.GetUsersStatsResponse.$type,
|
|
1182
|
+
users: globalThis.Array.isArray(object?.users) ? object.users.map((e) => exports.UserStat.fromJSON(e)) : [],
|
|
1183
|
+
};
|
|
1184
|
+
},
|
|
1185
|
+
toJSON(message) {
|
|
1186
|
+
const obj = {};
|
|
1187
|
+
if (message.users?.length) {
|
|
1188
|
+
obj.users = message.users.map((e) => exports.UserStat.toJSON(e));
|
|
1189
|
+
}
|
|
1190
|
+
return obj;
|
|
1191
|
+
},
|
|
1192
|
+
create(base) {
|
|
1193
|
+
return exports.GetUsersStatsResponse.fromPartial(base ?? {});
|
|
1194
|
+
},
|
|
1195
|
+
fromPartial(object) {
|
|
1196
|
+
const message = createBaseGetUsersStatsResponse();
|
|
1197
|
+
message.users = object.users?.map((e) => exports.UserStat.fromPartial(e)) || [];
|
|
1198
|
+
return message;
|
|
1199
|
+
},
|
|
1200
|
+
};
|
|
1201
|
+
typeRegistry_1.messageTypeRegistry.set(exports.GetUsersStatsResponse.$type, exports.GetUsersStatsResponse);
|
|
837
1202
|
function createBaseConfig() {
|
|
838
1203
|
return { $type: "xray.app.stats.command.Config" };
|
|
839
1204
|
}
|
|
@@ -925,6 +1290,14 @@ exports.StatsServiceDefinition = {
|
|
|
925
1290
|
responseStream: false,
|
|
926
1291
|
options: {},
|
|
927
1292
|
},
|
|
1293
|
+
getUsersStats: {
|
|
1294
|
+
name: "GetUsersStats",
|
|
1295
|
+
requestType: exports.GetUsersStatsRequest,
|
|
1296
|
+
requestStream: false,
|
|
1297
|
+
responseType: exports.GetUsersStatsResponse,
|
|
1298
|
+
responseStream: false,
|
|
1299
|
+
options: {},
|
|
1300
|
+
},
|
|
928
1301
|
},
|
|
929
1302
|
};
|
|
930
1303
|
function longToNumber(int64) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { SniffingConfig } from "../../app/proxyman/config";
|
|
2
3
|
export declare const protobufPackage = "xray.proxy.vless";
|
|
3
4
|
export interface Reverse {
|
|
4
5
|
$type: "xray.proxy.vless.Reverse";
|
|
5
6
|
tag: string;
|
|
7
|
+
sniffing: SniffingConfig | undefined;
|
|
6
8
|
}
|
|
7
9
|
export interface Account {
|
|
8
10
|
$type: "xray.proxy.vless.Account";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/vless/account.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/vless/account.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAElD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,0BAA0B,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,0BAA0B,CAAC;IAClC,8FAA8F;IAC9F,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC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CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -8,10 +8,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.Account = exports.Reverse = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const config_1 = require("../../app/proxyman/config");
|
|
11
12
|
const typeRegistry_1 = require("../../typeRegistry");
|
|
12
13
|
exports.protobufPackage = "xray.proxy.vless";
|
|
13
14
|
function createBaseReverse() {
|
|
14
|
-
return { $type: "xray.proxy.vless.Reverse", tag: "" };
|
|
15
|
+
return { $type: "xray.proxy.vless.Reverse", tag: "", sniffing: undefined };
|
|
15
16
|
}
|
|
16
17
|
exports.Reverse = {
|
|
17
18
|
$type: "xray.proxy.vless.Reverse",
|
|
@@ -19,6 +20,9 @@ exports.Reverse = {
|
|
|
19
20
|
if (message.tag !== "") {
|
|
20
21
|
writer.uint32(10).string(message.tag);
|
|
21
22
|
}
|
|
23
|
+
if (message.sniffing !== undefined) {
|
|
24
|
+
config_1.SniffingConfig.encode(message.sniffing, writer.uint32(18).fork()).join();
|
|
25
|
+
}
|
|
22
26
|
return writer;
|
|
23
27
|
},
|
|
24
28
|
decode(input, length) {
|
|
@@ -35,6 +39,13 @@ exports.Reverse = {
|
|
|
35
39
|
message.tag = reader.string();
|
|
36
40
|
continue;
|
|
37
41
|
}
|
|
42
|
+
case 2: {
|
|
43
|
+
if (tag !== 18) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
message.sniffing = config_1.SniffingConfig.decode(reader, reader.uint32());
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
38
49
|
}
|
|
39
50
|
if ((tag & 7) === 4 || tag === 0) {
|
|
40
51
|
break;
|
|
@@ -44,13 +55,20 @@ exports.Reverse = {
|
|
|
44
55
|
return message;
|
|
45
56
|
},
|
|
46
57
|
fromJSON(object) {
|
|
47
|
-
return {
|
|
58
|
+
return {
|
|
59
|
+
$type: exports.Reverse.$type,
|
|
60
|
+
tag: isSet(object.tag) ? globalThis.String(object.tag) : "",
|
|
61
|
+
sniffing: isSet(object.sniffing) ? config_1.SniffingConfig.fromJSON(object.sniffing) : undefined,
|
|
62
|
+
};
|
|
48
63
|
},
|
|
49
64
|
toJSON(message) {
|
|
50
65
|
const obj = {};
|
|
51
66
|
if (message.tag !== "") {
|
|
52
67
|
obj.tag = message.tag;
|
|
53
68
|
}
|
|
69
|
+
if (message.sniffing !== undefined) {
|
|
70
|
+
obj.sniffing = config_1.SniffingConfig.toJSON(message.sniffing);
|
|
71
|
+
}
|
|
54
72
|
return obj;
|
|
55
73
|
},
|
|
56
74
|
create(base) {
|
|
@@ -59,6 +77,9 @@ exports.Reverse = {
|
|
|
59
77
|
fromPartial(object) {
|
|
60
78
|
const message = createBaseReverse();
|
|
61
79
|
message.tag = object.tag ?? "";
|
|
80
|
+
message.sniffing = (object.sniffing !== undefined && object.sniffing !== null)
|
|
81
|
+
? config_1.SniffingConfig.fromPartial(object.sniffing)
|
|
82
|
+
: undefined;
|
|
62
83
|
return message;
|
|
63
84
|
},
|
|
64
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/transport/internet/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGjE,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD,oBAAY,cAAc;IACxB,KAAK,IAAI;IACT,MAAM,IAAI;IACV,OAAO,IAAI;IACX,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,Q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,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,gCAAgC,CA6GvE,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/transport/internet/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGjE,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD,oBAAY,cAAc;IACxB,KAAK,IAAI;IACT,MAAM,IAAI;IACV,OAAO,IAAI;IACX,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,SAAS,IAAI;IACb,SAAS,IAAI;IACb,UAAU,IAAI;IACd,UAAU,KAAK;IACf,YAAY,KAAK;CAClB;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,GAAG,cAAc,CAwClE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CA4BnE;AAED,oBAAY,mBAAmB;IAC7B,IAAI,IAAI;IACR,WAAW,IAAI;IACf,cAAc,IAAI;IAClB,iBAAiB,IAAI;IACrB,WAAW,IAAI;IACf,cAAc,IAAI;IAClB,iBAAiB,IAAI;IACrB,YAAY,KAAK;CAClB;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,GAAG,GAAG,mBAAmB,CA4B5E;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAoB7E;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,yCAAyC,CAAC;IACjD,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,Y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AU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,GAAG;KAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACvE,OAAO,CAAC,CAAC,CAAC,CAAC;AAiBf,MAAM,WAAW,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM;IAC7C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -625,6 +625,7 @@ function createBaseQuicParams() {
|
|
|
625
625
|
return {
|
|
626
626
|
$type: "xray.transport.internet.QuicParams",
|
|
627
627
|
congestion: "",
|
|
628
|
+
bbrProfile: "",
|
|
628
629
|
brutalUp: 0,
|
|
629
630
|
brutalDown: 0,
|
|
630
631
|
udpHop: undefined,
|
|
@@ -644,38 +645,41 @@ exports.QuicParams = {
|
|
|
644
645
|
if (message.congestion !== "") {
|
|
645
646
|
writer.uint32(10).string(message.congestion);
|
|
646
647
|
}
|
|
648
|
+
if (message.bbrProfile !== "") {
|
|
649
|
+
writer.uint32(18).string(message.bbrProfile);
|
|
650
|
+
}
|
|
647
651
|
if (message.brutalUp !== 0) {
|
|
648
|
-
writer.uint32(
|
|
652
|
+
writer.uint32(24).uint64(message.brutalUp);
|
|
649
653
|
}
|
|
650
654
|
if (message.brutalDown !== 0) {
|
|
651
|
-
writer.uint32(
|
|
655
|
+
writer.uint32(32).uint64(message.brutalDown);
|
|
652
656
|
}
|
|
653
657
|
if (message.udpHop !== undefined) {
|
|
654
|
-
exports.UdpHop.encode(message.udpHop, writer.uint32(
|
|
658
|
+
exports.UdpHop.encode(message.udpHop, writer.uint32(42).fork()).join();
|
|
655
659
|
}
|
|
656
660
|
if (message.initStreamReceiveWindow !== 0) {
|
|
657
|
-
writer.uint32(
|
|
661
|
+
writer.uint32(48).uint64(message.initStreamReceiveWindow);
|
|
658
662
|
}
|
|
659
663
|
if (message.maxStreamReceiveWindow !== 0) {
|
|
660
|
-
writer.uint32(
|
|
664
|
+
writer.uint32(56).uint64(message.maxStreamReceiveWindow);
|
|
661
665
|
}
|
|
662
666
|
if (message.initConnReceiveWindow !== 0) {
|
|
663
|
-
writer.uint32(
|
|
667
|
+
writer.uint32(64).uint64(message.initConnReceiveWindow);
|
|
664
668
|
}
|
|
665
669
|
if (message.maxConnReceiveWindow !== 0) {
|
|
666
|
-
writer.uint32(
|
|
670
|
+
writer.uint32(72).uint64(message.maxConnReceiveWindow);
|
|
667
671
|
}
|
|
668
672
|
if (message.maxIdleTimeout !== 0) {
|
|
669
|
-
writer.uint32(
|
|
673
|
+
writer.uint32(80).int64(message.maxIdleTimeout);
|
|
670
674
|
}
|
|
671
675
|
if (message.keepAlivePeriod !== 0) {
|
|
672
|
-
writer.uint32(
|
|
676
|
+
writer.uint32(88).int64(message.keepAlivePeriod);
|
|
673
677
|
}
|
|
674
678
|
if (message.disablePathMtuDiscovery !== false) {
|
|
675
|
-
writer.uint32(
|
|
679
|
+
writer.uint32(96).bool(message.disablePathMtuDiscovery);
|
|
676
680
|
}
|
|
677
681
|
if (message.maxIncomingStreams !== 0) {
|
|
678
|
-
writer.uint32(
|
|
682
|
+
writer.uint32(104).int64(message.maxIncomingStreams);
|
|
679
683
|
}
|
|
680
684
|
return writer;
|
|
681
685
|
},
|
|
@@ -694,79 +698,86 @@ exports.QuicParams = {
|
|
|
694
698
|
continue;
|
|
695
699
|
}
|
|
696
700
|
case 2: {
|
|
697
|
-
if (tag !==
|
|
701
|
+
if (tag !== 18) {
|
|
698
702
|
break;
|
|
699
703
|
}
|
|
700
|
-
message.
|
|
704
|
+
message.bbrProfile = reader.string();
|
|
701
705
|
continue;
|
|
702
706
|
}
|
|
703
707
|
case 3: {
|
|
704
708
|
if (tag !== 24) {
|
|
705
709
|
break;
|
|
706
710
|
}
|
|
707
|
-
message.
|
|
711
|
+
message.brutalUp = longToNumber(reader.uint64());
|
|
708
712
|
continue;
|
|
709
713
|
}
|
|
710
714
|
case 4: {
|
|
711
|
-
if (tag !==
|
|
715
|
+
if (tag !== 32) {
|
|
712
716
|
break;
|
|
713
717
|
}
|
|
714
|
-
message.
|
|
718
|
+
message.brutalDown = longToNumber(reader.uint64());
|
|
715
719
|
continue;
|
|
716
720
|
}
|
|
717
721
|
case 5: {
|
|
718
|
-
if (tag !==
|
|
722
|
+
if (tag !== 42) {
|
|
719
723
|
break;
|
|
720
724
|
}
|
|
721
|
-
message.
|
|
725
|
+
message.udpHop = exports.UdpHop.decode(reader, reader.uint32());
|
|
722
726
|
continue;
|
|
723
727
|
}
|
|
724
728
|
case 6: {
|
|
725
729
|
if (tag !== 48) {
|
|
726
730
|
break;
|
|
727
731
|
}
|
|
728
|
-
message.
|
|
732
|
+
message.initStreamReceiveWindow = longToNumber(reader.uint64());
|
|
729
733
|
continue;
|
|
730
734
|
}
|
|
731
735
|
case 7: {
|
|
732
736
|
if (tag !== 56) {
|
|
733
737
|
break;
|
|
734
738
|
}
|
|
735
|
-
message.
|
|
739
|
+
message.maxStreamReceiveWindow = longToNumber(reader.uint64());
|
|
736
740
|
continue;
|
|
737
741
|
}
|
|
738
742
|
case 8: {
|
|
739
743
|
if (tag !== 64) {
|
|
740
744
|
break;
|
|
741
745
|
}
|
|
742
|
-
message.
|
|
746
|
+
message.initConnReceiveWindow = longToNumber(reader.uint64());
|
|
743
747
|
continue;
|
|
744
748
|
}
|
|
745
749
|
case 9: {
|
|
746
750
|
if (tag !== 72) {
|
|
747
751
|
break;
|
|
748
752
|
}
|
|
749
|
-
message.
|
|
753
|
+
message.maxConnReceiveWindow = longToNumber(reader.uint64());
|
|
750
754
|
continue;
|
|
751
755
|
}
|
|
752
756
|
case 10: {
|
|
753
757
|
if (tag !== 80) {
|
|
754
758
|
break;
|
|
755
759
|
}
|
|
756
|
-
message.
|
|
760
|
+
message.maxIdleTimeout = longToNumber(reader.int64());
|
|
757
761
|
continue;
|
|
758
762
|
}
|
|
759
763
|
case 11: {
|
|
760
764
|
if (tag !== 88) {
|
|
761
765
|
break;
|
|
762
766
|
}
|
|
763
|
-
message.
|
|
767
|
+
message.keepAlivePeriod = longToNumber(reader.int64());
|
|
764
768
|
continue;
|
|
765
769
|
}
|
|
766
770
|
case 12: {
|
|
767
771
|
if (tag !== 96) {
|
|
768
772
|
break;
|
|
769
773
|
}
|
|
774
|
+
message.disablePathMtuDiscovery = reader.bool();
|
|
775
|
+
continue;
|
|
776
|
+
}
|
|
777
|
+
case 13: {
|
|
778
|
+
if (tag !== 104) {
|
|
779
|
+
break;
|
|
780
|
+
}
|
|
770
781
|
message.maxIncomingStreams = longToNumber(reader.int64());
|
|
771
782
|
continue;
|
|
772
783
|
}
|
|
@@ -782,6 +793,11 @@ exports.QuicParams = {
|
|
|
782
793
|
return {
|
|
783
794
|
$type: exports.QuicParams.$type,
|
|
784
795
|
congestion: isSet(object.congestion) ? globalThis.String(object.congestion) : "",
|
|
796
|
+
bbrProfile: isSet(object.bbrProfile)
|
|
797
|
+
? globalThis.String(object.bbrProfile)
|
|
798
|
+
: isSet(object.bbr_profile)
|
|
799
|
+
? globalThis.String(object.bbr_profile)
|
|
800
|
+
: "",
|
|
785
801
|
brutalUp: isSet(object.brutalUp)
|
|
786
802
|
? globalThis.Number(object.brutalUp)
|
|
787
803
|
: isSet(object.brutal_up)
|
|
@@ -844,6 +860,9 @@ exports.QuicParams = {
|
|
|
844
860
|
if (message.congestion !== "") {
|
|
845
861
|
obj.congestion = message.congestion;
|
|
846
862
|
}
|
|
863
|
+
if (message.bbrProfile !== "") {
|
|
864
|
+
obj.bbrProfile = message.bbrProfile;
|
|
865
|
+
}
|
|
847
866
|
if (message.brutalUp !== 0) {
|
|
848
867
|
obj.brutalUp = Math.round(message.brutalUp);
|
|
849
868
|
}
|
|
@@ -885,6 +904,7 @@ exports.QuicParams = {
|
|
|
885
904
|
fromPartial(object) {
|
|
886
905
|
const message = createBaseQuicParams();
|
|
887
906
|
message.congestion = object.congestion ?? "";
|
|
907
|
+
message.bbrProfile = object.bbrProfile ?? "";
|
|
888
908
|
message.brutalUp = object.brutalUp ?? 0;
|
|
889
909
|
message.brutalDown = object.brutalDown ?? 0;
|
|
890
910
|
message.udpHop = (object.udpHop !== undefined && object.udpHop !== null)
|