@remnawave/xtls-sdk 0.11.1 → 0.12.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/build/src/handler/handler.service.d.ts +33 -1
- package/build/src/handler/handler.service.d.ts.map +1 -1
- package/build/src/handler/handler.service.js +76 -8
- package/build/src/handler/interfaces/add-user/add-hysteria-user.interface.d.ts +7 -0
- package/build/src/handler/interfaces/add-user/add-hysteria-user.interface.d.ts.map +1 -0
- package/build/src/handler/interfaces/add-user/add-hysteria-user.interface.js +2 -0
- package/build/src/handler/interfaces/add-user/index.d.ts +4 -3
- package/build/src/handler/interfaces/add-user/index.d.ts.map +1 -1
- package/build/src/handler/interfaces/add-user/index.js +4 -3
- package/build/src/xray-protos/app/router/config.d.ts +16 -0
- package/build/src/xray-protos/app/router/config.d.ts.map +1 -1
- package/build/src/xray-protos/app/router/config.js +195 -1
- package/build/src/xray-protos/proxy/hysteria/account/config.d.ts +22 -0
- package/build/src/xray-protos/proxy/hysteria/account/config.d.ts.map +1 -0
- package/build/src/xray-protos/proxy/hysteria/account/config.js +68 -0
- package/build/src/xray-protos/proxy/hysteria/config.d.ts +6 -0
- package/build/src/xray-protos/proxy/hysteria/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/hysteria/config.js +58 -1
- package/build/src/xray-protos/transport/internet/config.d.ts +24 -0
- package/build/src/xray-protos/transport/internet/config.d.ts.map +1 -1
- package/build/src/xray-protos/transport/internet/config.js +407 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Channel } from 'nice-grpc';
|
|
2
|
+
import { IAddHttpUser, IAddHysteriaUser, IAddShadowsocks2022User, IAddShadowsocksUser, IAddSocksUser, IAddTrojanUser, IAddVlessUser } from './interfaces';
|
|
2
3
|
import { HandlerServiceClient } from '../xray-protos/app/proxyman/command/command';
|
|
3
|
-
import { IAddHttpUser, IAddShadowsocks2022User, IAddShadowsocksUser, IAddSocksUser, IAddTrojanUser, IAddVlessUser } from './interfaces';
|
|
4
4
|
import { AddUserResponseModel, GetInboundUsersResponseModel, RemoveUserResponseModel } from './models';
|
|
5
5
|
import { ISdkResponse } from '../common/types/sdk-response';
|
|
6
6
|
/**
|
|
@@ -86,6 +86,38 @@ export declare class HandlerService {
|
|
|
86
86
|
* - On failure: An object with `isOk: false` and error details from HANDLER_ERRORS
|
|
87
87
|
*/
|
|
88
88
|
addHttpUser(data: IAddHttpUser): Promise<ISdkResponse<AddUserResponseModel>>;
|
|
89
|
+
/**
|
|
90
|
+
* Adds a new Hysteria user to a specified inbound handler.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* This method adds a user for the Hysteria protocol to an Xray server inbound handler.
|
|
94
|
+
*
|
|
95
|
+
* @param data - The user data for the new Hysteria user.
|
|
96
|
+
* @param data.tag - The tag identifying the inbound handler.
|
|
97
|
+
* @param data.username - The email/username for the user.
|
|
98
|
+
* @param data.level - The user privilege level.
|
|
99
|
+
* @param data.uuid - The authentication string for Hysteria (typically a password).
|
|
100
|
+
*
|
|
101
|
+
* @returns A promise that resolves to an {@link ISdkResponse} containing {@link AddUserResponseModel}.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const handler = new HandlerService(channel);
|
|
106
|
+
* const result = await handler.addHysteriaUser({
|
|
107
|
+
* tag: 'hysteria-inbound',
|
|
108
|
+
* username: 'example@example.com',
|
|
109
|
+
* level: 0,
|
|
110
|
+
* uuid: 'random-password',
|
|
111
|
+
* });
|
|
112
|
+
* if (result.isOk && result.data.success) {
|
|
113
|
+
* // User added successfully
|
|
114
|
+
* }
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @throws An error with details from {@link HANDLER_ERRORS.ADD_USER_ERROR} if the operation fails.
|
|
118
|
+
* Returns `isOk: true` and `success: false` if the user already exists.
|
|
119
|
+
*/
|
|
120
|
+
addHysteriaUser(data: IAddHysteriaUser): Promise<ISdkResponse<AddUserResponseModel>>;
|
|
89
121
|
/**
|
|
90
122
|
* Removes a user from a specified inbound handler.
|
|
91
123
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.service.d.ts","sourceRoot":"","sources":["../../../src/handler/handler.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,
|
|
1
|
+
{"version":3,"file":"handler.service.d.ts","sourceRoot":"","sources":["../../../src/handler/handler.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EACH,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,aAAa,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEH,oBAAoB,EAGvB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACH,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,EAC1B,MAAM,UAAU,CAAC;AASlB,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI5D;;GAEG;AACH,qBAAa,cAAc;IAGX,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;gBAEjB,OAAO,EAAE,OAAO;IAI7C;;;;;;;;;;;;;;;;;;;;OAoBG;IACU,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAoB9F;;;;;;;OAOG;IACU,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAuC7F;;;;;;;OAOG;IACU,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAyC3F;;;;;;;OAOG;IACU,kBAAkB,CAC3B,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAyC9C;;;;;;;OAOG;IACU,sBAAsB,CAC/B,IAAI,EAAE,uBAAuB,GAC9B,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAuC9C;;;;;;;OAOG;IACU,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAwC3F;;;;;;;OAOG;IACU,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAwCzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACU,eAAe,CACxB,IAAI,EAAE,gBAAgB,GACvB,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAuC9C;;;;;;;;OAQG;IACU,UAAU,CACnB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;IA+BjD;;;;;;;OAOG;IACU,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAmB7E;;;OAGG;IACH,IAAW,SAAS,IAAI,oBAAoB,CAE3C;CACJ"}
|
|
@@ -9,11 +9,12 @@ const command_1 = require("../xray-protos/app/proxyman/command/command");
|
|
|
9
9
|
const models_1 = require("./models");
|
|
10
10
|
const config_1 = require("../xray-protos/proxy/shadowsocks_2022/config");
|
|
11
11
|
const create_typed_message_1 = __importDefault(require("../common/utils/create-typed-message/create-typed-message"));
|
|
12
|
-
const config_2 = require("../xray-protos/proxy/
|
|
13
|
-
const config_3 = require("../xray-protos/proxy/
|
|
12
|
+
const config_2 = require("../xray-protos/proxy/hysteria/account/config");
|
|
13
|
+
const config_3 = require("../xray-protos/proxy/shadowsocks/config");
|
|
14
|
+
const config_4 = require("../xray-protos/proxy/trojan/config");
|
|
14
15
|
const account_1 = require("../xray-protos/proxy/vless/account");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
16
|
+
const config_5 = require("../xray-protos/proxy/socks/config");
|
|
17
|
+
const config_6 = require("../xray-protos/proxy/http/config");
|
|
17
18
|
const user_1 = require("../xray-protos/common/protocol/user");
|
|
18
19
|
const errors_1 = require("../common/errors");
|
|
19
20
|
/**
|
|
@@ -80,7 +81,7 @@ class HandlerService {
|
|
|
80
81
|
user: user_1.User.create({
|
|
81
82
|
email: data.username,
|
|
82
83
|
level: data.level,
|
|
83
|
-
account: (0, create_typed_message_1.default)(
|
|
84
|
+
account: (0, create_typed_message_1.default)(config_4.Account, {
|
|
84
85
|
password: data.password,
|
|
85
86
|
}),
|
|
86
87
|
}),
|
|
@@ -170,7 +171,7 @@ class HandlerService {
|
|
|
170
171
|
user: user_1.User.create({
|
|
171
172
|
email: data.username,
|
|
172
173
|
level: data.level,
|
|
173
|
-
account: (0, create_typed_message_1.default)(
|
|
174
|
+
account: (0, create_typed_message_1.default)(config_3.Account, {
|
|
174
175
|
password: data.password,
|
|
175
176
|
cipherType: data.cipherType,
|
|
176
177
|
ivCheck: data.ivCheck,
|
|
@@ -260,7 +261,7 @@ class HandlerService {
|
|
|
260
261
|
user: user_1.User.create({
|
|
261
262
|
email: data.username,
|
|
262
263
|
level: data.level,
|
|
263
|
-
account: (0, create_typed_message_1.default)(
|
|
264
|
+
account: (0, create_typed_message_1.default)(config_5.Account, {
|
|
264
265
|
username: data.socks_username,
|
|
265
266
|
password: data.socks_password,
|
|
266
267
|
}),
|
|
@@ -305,7 +306,7 @@ class HandlerService {
|
|
|
305
306
|
user: user_1.User.create({
|
|
306
307
|
email: data.username,
|
|
307
308
|
level: data.level,
|
|
308
|
-
account: (0, create_typed_message_1.default)(
|
|
309
|
+
account: (0, create_typed_message_1.default)(config_6.Account, {
|
|
309
310
|
username: data.http_username,
|
|
310
311
|
password: data.http_password,
|
|
311
312
|
}),
|
|
@@ -334,6 +335,73 @@ class HandlerService {
|
|
|
334
335
|
};
|
|
335
336
|
}
|
|
336
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Adds a new Hysteria user to a specified inbound handler.
|
|
340
|
+
*
|
|
341
|
+
* @remarks
|
|
342
|
+
* This method adds a user for the Hysteria protocol to an Xray server inbound handler.
|
|
343
|
+
*
|
|
344
|
+
* @param data - The user data for the new Hysteria user.
|
|
345
|
+
* @param data.tag - The tag identifying the inbound handler.
|
|
346
|
+
* @param data.username - The email/username for the user.
|
|
347
|
+
* @param data.level - The user privilege level.
|
|
348
|
+
* @param data.uuid - The authentication string for Hysteria (typically a password).
|
|
349
|
+
*
|
|
350
|
+
* @returns A promise that resolves to an {@link ISdkResponse} containing {@link AddUserResponseModel}.
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```typescript
|
|
354
|
+
* const handler = new HandlerService(channel);
|
|
355
|
+
* const result = await handler.addHysteriaUser({
|
|
356
|
+
* tag: 'hysteria-inbound',
|
|
357
|
+
* username: 'example@example.com',
|
|
358
|
+
* level: 0,
|
|
359
|
+
* uuid: 'random-password',
|
|
360
|
+
* });
|
|
361
|
+
* if (result.isOk && result.data.success) {
|
|
362
|
+
* // User added successfully
|
|
363
|
+
* }
|
|
364
|
+
* ```
|
|
365
|
+
*
|
|
366
|
+
* @throws An error with details from {@link HANDLER_ERRORS.ADD_USER_ERROR} if the operation fails.
|
|
367
|
+
* Returns `isOk: true` and `success: false` if the user already exists.
|
|
368
|
+
*/
|
|
369
|
+
async addHysteriaUser(data) {
|
|
370
|
+
try {
|
|
371
|
+
await this.client.alterInbound({
|
|
372
|
+
tag: data.tag,
|
|
373
|
+
operation: (0, create_typed_message_1.default)(command_1.AddUserOperation, {
|
|
374
|
+
user: user_1.User.create({
|
|
375
|
+
email: data.username,
|
|
376
|
+
level: data.level,
|
|
377
|
+
account: (0, create_typed_message_1.default)(config_2.Account, {
|
|
378
|
+
auth: data.uuid,
|
|
379
|
+
}),
|
|
380
|
+
}),
|
|
381
|
+
}),
|
|
382
|
+
});
|
|
383
|
+
return {
|
|
384
|
+
isOk: true,
|
|
385
|
+
data: new models_1.AddUserResponseModel(true),
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
catch (error) {
|
|
389
|
+
let message = '';
|
|
390
|
+
if (error instanceof Error) {
|
|
391
|
+
message = error.message;
|
|
392
|
+
}
|
|
393
|
+
if (message.includes('already exists')) {
|
|
394
|
+
return {
|
|
395
|
+
isOk: true,
|
|
396
|
+
data: new models_1.AddUserResponseModel(false),
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
return {
|
|
400
|
+
isOk: false,
|
|
401
|
+
...errors_1.HANDLER_ERRORS.ADD_USER_ERROR(message),
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
}
|
|
337
405
|
/**
|
|
338
406
|
* Removes a user from a specified inbound handler.
|
|
339
407
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-hysteria-user.interface.d.ts","sourceRoot":"","sources":["../../../../../src/handler/interfaces/add-user/add-hysteria-user.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from './add-
|
|
2
|
-
export * from './add-
|
|
1
|
+
export * from './add-http-user.interface';
|
|
2
|
+
export * from './add-hysteria-user.interface';
|
|
3
3
|
export * from './add-shadowsocks-user.interface';
|
|
4
4
|
export * from './add-shadowsocks2022-user.interface';
|
|
5
5
|
export * from './add-socks-user.interface';
|
|
6
|
-
export * from './add-
|
|
6
|
+
export * from './add-trojan-user.interface';
|
|
7
|
+
export * from './add-vless-user.interface';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/handler/interfaces/add-user/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/handler/interfaces/add-user/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
|
@@ -14,9 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./add-
|
|
18
|
-
__exportStar(require("./add-
|
|
17
|
+
__exportStar(require("./add-http-user.interface"), exports);
|
|
18
|
+
__exportStar(require("./add-hysteria-user.interface"), exports);
|
|
19
19
|
__exportStar(require("./add-shadowsocks-user.interface"), exports);
|
|
20
20
|
__exportStar(require("./add-shadowsocks2022-user.interface"), exports);
|
|
21
21
|
__exportStar(require("./add-socks-user.interface"), exports);
|
|
22
|
-
__exportStar(require("./add-
|
|
22
|
+
__exportStar(require("./add-trojan-user.interface"), exports);
|
|
23
|
+
__exportStar(require("./add-vless-user.interface"), exports);
|
|
@@ -97,12 +97,26 @@ export interface RoutingRule {
|
|
|
97
97
|
localPortList: PortList | undefined;
|
|
98
98
|
vlessRouteList: PortList | undefined;
|
|
99
99
|
process: string[];
|
|
100
|
+
webhook: WebhookConfig | undefined;
|
|
100
101
|
}
|
|
101
102
|
export interface RoutingRule_AttributesEntry {
|
|
102
103
|
$type: "xray.app.router.RoutingRule.AttributesEntry";
|
|
103
104
|
key: string;
|
|
104
105
|
value: string;
|
|
105
106
|
}
|
|
107
|
+
export interface WebhookConfig {
|
|
108
|
+
$type: "xray.app.router.WebhookConfig";
|
|
109
|
+
url: string;
|
|
110
|
+
deduplication: number;
|
|
111
|
+
headers: {
|
|
112
|
+
[key: string]: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export interface WebhookConfig_HeadersEntry {
|
|
116
|
+
$type: "xray.app.router.WebhookConfig.HeadersEntry";
|
|
117
|
+
key: string;
|
|
118
|
+
value: string;
|
|
119
|
+
}
|
|
106
120
|
export interface BalancingRule {
|
|
107
121
|
$type: "xray.app.router.BalancingRule";
|
|
108
122
|
tag: string;
|
|
@@ -156,6 +170,8 @@ export declare const GeoSite: MessageFns<GeoSite, "xray.app.router.GeoSite">;
|
|
|
156
170
|
export declare const GeoSiteList: MessageFns<GeoSiteList, "xray.app.router.GeoSiteList">;
|
|
157
171
|
export declare const RoutingRule: MessageFns<RoutingRule, "xray.app.router.RoutingRule">;
|
|
158
172
|
export declare const RoutingRule_AttributesEntry: MessageFns<RoutingRule_AttributesEntry, "xray.app.router.RoutingRule.AttributesEntry">;
|
|
173
|
+
export declare const WebhookConfig: MessageFns<WebhookConfig, "xray.app.router.WebhookConfig">;
|
|
174
|
+
export declare const WebhookConfig_HeadersEntry: MessageFns<WebhookConfig_HeadersEntry, "xray.app.router.WebhookConfig.HeadersEntry">;
|
|
159
175
|
export declare const BalancingRule: MessageFns<BalancingRule, "xray.app.router.BalancingRule">;
|
|
160
176
|
export declare const StrategyWeight: MessageFns<StrategyWeight, "xray.app.router.StrategyWeight">;
|
|
161
177
|
export declare const StrategyLeastLoadConfig: MessageFns<StrategyLeastLoadConfig, "xray.app.router.StrategyLeastLoadConfig">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/app/router/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yB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AE,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/router/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.Config = exports.StrategyLeastLoadConfig = exports.StrategyWeight = exports.BalancingRule = exports.RoutingRule_AttributesEntry = exports.RoutingRule = exports.GeoSiteList = exports.GeoSite = exports.GeoIPList = exports.GeoIP = exports.CIDR = exports.Domain_Attribute = exports.Domain = exports.Config_DomainStrategy = exports.Domain_Type = exports.protobufPackage = void 0;
|
|
8
|
+
exports.Config = exports.StrategyLeastLoadConfig = exports.StrategyWeight = exports.BalancingRule = exports.WebhookConfig_HeadersEntry = exports.WebhookConfig = exports.RoutingRule_AttributesEntry = exports.RoutingRule = exports.GeoSiteList = exports.GeoSite = exports.GeoIPList = exports.GeoIP = exports.CIDR = exports.Domain_Attribute = exports.Domain = exports.Config_DomainStrategy = exports.Domain_Type = exports.protobufPackage = void 0;
|
|
9
9
|
exports.domain_TypeFromJSON = domain_TypeFromJSON;
|
|
10
10
|
exports.domain_TypeToJSON = domain_TypeToJSON;
|
|
11
11
|
exports.config_DomainStrategyFromJSON = config_DomainStrategyFromJSON;
|
|
@@ -659,6 +659,7 @@ function createBaseRoutingRule() {
|
|
|
659
659
|
localPortList: undefined,
|
|
660
660
|
vlessRouteList: undefined,
|
|
661
661
|
process: [],
|
|
662
|
+
webhook: undefined,
|
|
662
663
|
};
|
|
663
664
|
}
|
|
664
665
|
exports.RoutingRule = {
|
|
@@ -721,6 +722,9 @@ exports.RoutingRule = {
|
|
|
721
722
|
for (const v of message.process) {
|
|
722
723
|
writer.uint32(170).string(v);
|
|
723
724
|
}
|
|
725
|
+
if (message.webhook !== undefined) {
|
|
726
|
+
exports.WebhookConfig.encode(message.webhook, writer.uint32(178).fork()).join();
|
|
727
|
+
}
|
|
724
728
|
return writer;
|
|
725
729
|
},
|
|
726
730
|
decode(input, length) {
|
|
@@ -859,6 +863,13 @@ exports.RoutingRule = {
|
|
|
859
863
|
message.process.push(reader.string());
|
|
860
864
|
continue;
|
|
861
865
|
}
|
|
866
|
+
case 22: {
|
|
867
|
+
if (tag !== 178) {
|
|
868
|
+
break;
|
|
869
|
+
}
|
|
870
|
+
message.webhook = exports.WebhookConfig.decode(reader, reader.uint32());
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
862
873
|
}
|
|
863
874
|
if ((tag & 7) === 4 || tag === 0) {
|
|
864
875
|
break;
|
|
@@ -936,6 +947,7 @@ exports.RoutingRule = {
|
|
|
936
947
|
process: globalThis.Array.isArray(object?.process)
|
|
937
948
|
? object.process.map((e) => globalThis.String(e))
|
|
938
949
|
: [],
|
|
950
|
+
webhook: isSet(object.webhook) ? exports.WebhookConfig.fromJSON(object.webhook) : undefined,
|
|
939
951
|
};
|
|
940
952
|
},
|
|
941
953
|
toJSON(message) {
|
|
@@ -997,6 +1009,9 @@ exports.RoutingRule = {
|
|
|
997
1009
|
if (message.process?.length) {
|
|
998
1010
|
obj.process = message.process;
|
|
999
1011
|
}
|
|
1012
|
+
if (message.webhook !== undefined) {
|
|
1013
|
+
obj.webhook = exports.WebhookConfig.toJSON(message.webhook);
|
|
1014
|
+
}
|
|
1000
1015
|
return obj;
|
|
1001
1016
|
},
|
|
1002
1017
|
create(base) {
|
|
@@ -1034,6 +1049,9 @@ exports.RoutingRule = {
|
|
|
1034
1049
|
? port_1.PortList.fromPartial(object.vlessRouteList)
|
|
1035
1050
|
: undefined;
|
|
1036
1051
|
message.process = object.process?.map((e) => e) || [];
|
|
1052
|
+
message.webhook = (object.webhook !== undefined && object.webhook !== null)
|
|
1053
|
+
? exports.WebhookConfig.fromPartial(object.webhook)
|
|
1054
|
+
: undefined;
|
|
1037
1055
|
return message;
|
|
1038
1056
|
},
|
|
1039
1057
|
};
|
|
@@ -1109,6 +1127,182 @@ exports.RoutingRule_AttributesEntry = {
|
|
|
1109
1127
|
},
|
|
1110
1128
|
};
|
|
1111
1129
|
typeRegistry_1.messageTypeRegistry.set(exports.RoutingRule_AttributesEntry.$type, exports.RoutingRule_AttributesEntry);
|
|
1130
|
+
function createBaseWebhookConfig() {
|
|
1131
|
+
return { $type: "xray.app.router.WebhookConfig", url: "", deduplication: 0, headers: {} };
|
|
1132
|
+
}
|
|
1133
|
+
exports.WebhookConfig = {
|
|
1134
|
+
$type: "xray.app.router.WebhookConfig",
|
|
1135
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1136
|
+
if (message.url !== "") {
|
|
1137
|
+
writer.uint32(10).string(message.url);
|
|
1138
|
+
}
|
|
1139
|
+
if (message.deduplication !== 0) {
|
|
1140
|
+
writer.uint32(16).uint32(message.deduplication);
|
|
1141
|
+
}
|
|
1142
|
+
globalThis.Object.entries(message.headers).forEach(([key, value]) => {
|
|
1143
|
+
exports.WebhookConfig_HeadersEntry.encode({ $type: "xray.app.router.WebhookConfig.HeadersEntry", key: key, value }, writer.uint32(26).fork()).join();
|
|
1144
|
+
});
|
|
1145
|
+
return writer;
|
|
1146
|
+
},
|
|
1147
|
+
decode(input, length) {
|
|
1148
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1149
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1150
|
+
const message = createBaseWebhookConfig();
|
|
1151
|
+
while (reader.pos < end) {
|
|
1152
|
+
const tag = reader.uint32();
|
|
1153
|
+
switch (tag >>> 3) {
|
|
1154
|
+
case 1: {
|
|
1155
|
+
if (tag !== 10) {
|
|
1156
|
+
break;
|
|
1157
|
+
}
|
|
1158
|
+
message.url = reader.string();
|
|
1159
|
+
continue;
|
|
1160
|
+
}
|
|
1161
|
+
case 2: {
|
|
1162
|
+
if (tag !== 16) {
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
message.deduplication = reader.uint32();
|
|
1166
|
+
continue;
|
|
1167
|
+
}
|
|
1168
|
+
case 3: {
|
|
1169
|
+
if (tag !== 26) {
|
|
1170
|
+
break;
|
|
1171
|
+
}
|
|
1172
|
+
const entry3 = exports.WebhookConfig_HeadersEntry.decode(reader, reader.uint32());
|
|
1173
|
+
if (entry3.value !== undefined) {
|
|
1174
|
+
message.headers[entry3.key] = entry3.value;
|
|
1175
|
+
}
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1180
|
+
break;
|
|
1181
|
+
}
|
|
1182
|
+
reader.skip(tag & 7);
|
|
1183
|
+
}
|
|
1184
|
+
return message;
|
|
1185
|
+
},
|
|
1186
|
+
fromJSON(object) {
|
|
1187
|
+
return {
|
|
1188
|
+
$type: exports.WebhookConfig.$type,
|
|
1189
|
+
url: isSet(object.url) ? globalThis.String(object.url) : "",
|
|
1190
|
+
deduplication: isSet(object.deduplication) ? globalThis.Number(object.deduplication) : 0,
|
|
1191
|
+
headers: isObject(object.headers)
|
|
1192
|
+
? globalThis.Object.entries(object.headers).reduce((acc, [key, value]) => {
|
|
1193
|
+
acc[key] = globalThis.String(value);
|
|
1194
|
+
return acc;
|
|
1195
|
+
}, {})
|
|
1196
|
+
: {},
|
|
1197
|
+
};
|
|
1198
|
+
},
|
|
1199
|
+
toJSON(message) {
|
|
1200
|
+
const obj = {};
|
|
1201
|
+
if (message.url !== "") {
|
|
1202
|
+
obj.url = message.url;
|
|
1203
|
+
}
|
|
1204
|
+
if (message.deduplication !== 0) {
|
|
1205
|
+
obj.deduplication = Math.round(message.deduplication);
|
|
1206
|
+
}
|
|
1207
|
+
if (message.headers) {
|
|
1208
|
+
const entries = globalThis.Object.entries(message.headers);
|
|
1209
|
+
if (entries.length > 0) {
|
|
1210
|
+
obj.headers = {};
|
|
1211
|
+
entries.forEach(([k, v]) => {
|
|
1212
|
+
obj.headers[k] = v;
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
return obj;
|
|
1217
|
+
},
|
|
1218
|
+
create(base) {
|
|
1219
|
+
return exports.WebhookConfig.fromPartial(base ?? {});
|
|
1220
|
+
},
|
|
1221
|
+
fromPartial(object) {
|
|
1222
|
+
const message = createBaseWebhookConfig();
|
|
1223
|
+
message.url = object.url ?? "";
|
|
1224
|
+
message.deduplication = object.deduplication ?? 0;
|
|
1225
|
+
message.headers = globalThis.Object.entries(object.headers ?? {}).reduce((acc, [key, value]) => {
|
|
1226
|
+
if (value !== undefined) {
|
|
1227
|
+
acc[key] = globalThis.String(value);
|
|
1228
|
+
}
|
|
1229
|
+
return acc;
|
|
1230
|
+
}, {});
|
|
1231
|
+
return message;
|
|
1232
|
+
},
|
|
1233
|
+
};
|
|
1234
|
+
typeRegistry_1.messageTypeRegistry.set(exports.WebhookConfig.$type, exports.WebhookConfig);
|
|
1235
|
+
function createBaseWebhookConfig_HeadersEntry() {
|
|
1236
|
+
return { $type: "xray.app.router.WebhookConfig.HeadersEntry", key: "", value: "" };
|
|
1237
|
+
}
|
|
1238
|
+
exports.WebhookConfig_HeadersEntry = {
|
|
1239
|
+
$type: "xray.app.router.WebhookConfig.HeadersEntry",
|
|
1240
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1241
|
+
if (message.key !== "") {
|
|
1242
|
+
writer.uint32(10).string(message.key);
|
|
1243
|
+
}
|
|
1244
|
+
if (message.value !== "") {
|
|
1245
|
+
writer.uint32(18).string(message.value);
|
|
1246
|
+
}
|
|
1247
|
+
return writer;
|
|
1248
|
+
},
|
|
1249
|
+
decode(input, length) {
|
|
1250
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1251
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1252
|
+
const message = createBaseWebhookConfig_HeadersEntry();
|
|
1253
|
+
while (reader.pos < end) {
|
|
1254
|
+
const tag = reader.uint32();
|
|
1255
|
+
switch (tag >>> 3) {
|
|
1256
|
+
case 1: {
|
|
1257
|
+
if (tag !== 10) {
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1260
|
+
message.key = reader.string();
|
|
1261
|
+
continue;
|
|
1262
|
+
}
|
|
1263
|
+
case 2: {
|
|
1264
|
+
if (tag !== 18) {
|
|
1265
|
+
break;
|
|
1266
|
+
}
|
|
1267
|
+
message.value = reader.string();
|
|
1268
|
+
continue;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1272
|
+
break;
|
|
1273
|
+
}
|
|
1274
|
+
reader.skip(tag & 7);
|
|
1275
|
+
}
|
|
1276
|
+
return message;
|
|
1277
|
+
},
|
|
1278
|
+
fromJSON(object) {
|
|
1279
|
+
return {
|
|
1280
|
+
$type: exports.WebhookConfig_HeadersEntry.$type,
|
|
1281
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
1282
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
1283
|
+
};
|
|
1284
|
+
},
|
|
1285
|
+
toJSON(message) {
|
|
1286
|
+
const obj = {};
|
|
1287
|
+
if (message.key !== "") {
|
|
1288
|
+
obj.key = message.key;
|
|
1289
|
+
}
|
|
1290
|
+
if (message.value !== "") {
|
|
1291
|
+
obj.value = message.value;
|
|
1292
|
+
}
|
|
1293
|
+
return obj;
|
|
1294
|
+
},
|
|
1295
|
+
create(base) {
|
|
1296
|
+
return exports.WebhookConfig_HeadersEntry.fromPartial(base ?? {});
|
|
1297
|
+
},
|
|
1298
|
+
fromPartial(object) {
|
|
1299
|
+
const message = createBaseWebhookConfig_HeadersEntry();
|
|
1300
|
+
message.key = object.key ?? "";
|
|
1301
|
+
message.value = object.value ?? "";
|
|
1302
|
+
return message;
|
|
1303
|
+
},
|
|
1304
|
+
};
|
|
1305
|
+
typeRegistry_1.messageTypeRegistry.set(exports.WebhookConfig_HeadersEntry.$type, exports.WebhookConfig_HeadersEntry);
|
|
1112
1306
|
function createBaseBalancingRule() {
|
|
1113
1307
|
return {
|
|
1114
1308
|
$type: "xray.app.router.BalancingRule",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "xray.proxy.hysteria.account";
|
|
3
|
+
export interface Account {
|
|
4
|
+
$type: "xray.proxy.hysteria.account.Account";
|
|
5
|
+
auth: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Account: MessageFns<Account, "xray.proxy.hysteria.account.Account">;
|
|
8
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
9
|
+
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 {} ? {
|
|
10
|
+
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
11
|
+
} : Partial<T>;
|
|
12
|
+
export interface MessageFns<T, V extends string> {
|
|
13
|
+
readonly $type: V;
|
|
14
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
15
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
16
|
+
fromJSON(object: any): T;
|
|
17
|
+
toJSON(message: T): unknown;
|
|
18
|
+
create(base?: DeepPartial<T>): T;
|
|
19
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/proxy/hysteria/account/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAE7D,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,qCAAqC,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;CACd;AAMD,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,qCAAqC,CAsD9E,CAAC;AAIF,KAAK,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,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;AAMf,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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.2
|
|
5
|
+
// protoc v6.33.4
|
|
6
|
+
// source: proxy/hysteria/account/config.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Account = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const typeRegistry_1 = require("../../../typeRegistry");
|
|
12
|
+
exports.protobufPackage = "xray.proxy.hysteria.account";
|
|
13
|
+
function createBaseAccount() {
|
|
14
|
+
return { $type: "xray.proxy.hysteria.account.Account", auth: "" };
|
|
15
|
+
}
|
|
16
|
+
exports.Account = {
|
|
17
|
+
$type: "xray.proxy.hysteria.account.Account",
|
|
18
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
19
|
+
if (message.auth !== "") {
|
|
20
|
+
writer.uint32(10).string(message.auth);
|
|
21
|
+
}
|
|
22
|
+
return writer;
|
|
23
|
+
},
|
|
24
|
+
decode(input, length) {
|
|
25
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
26
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
27
|
+
const message = createBaseAccount();
|
|
28
|
+
while (reader.pos < end) {
|
|
29
|
+
const tag = reader.uint32();
|
|
30
|
+
switch (tag >>> 3) {
|
|
31
|
+
case 1: {
|
|
32
|
+
if (tag !== 10) {
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
message.auth = reader.string();
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
reader.skip(tag & 7);
|
|
43
|
+
}
|
|
44
|
+
return message;
|
|
45
|
+
},
|
|
46
|
+
fromJSON(object) {
|
|
47
|
+
return { $type: exports.Account.$type, auth: isSet(object.auth) ? globalThis.String(object.auth) : "" };
|
|
48
|
+
},
|
|
49
|
+
toJSON(message) {
|
|
50
|
+
const obj = {};
|
|
51
|
+
if (message.auth !== "") {
|
|
52
|
+
obj.auth = message.auth;
|
|
53
|
+
}
|
|
54
|
+
return obj;
|
|
55
|
+
},
|
|
56
|
+
create(base) {
|
|
57
|
+
return exports.Account.fromPartial(base ?? {});
|
|
58
|
+
},
|
|
59
|
+
fromPartial(object) {
|
|
60
|
+
const message = createBaseAccount();
|
|
61
|
+
message.auth = object.auth ?? "";
|
|
62
|
+
return message;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
typeRegistry_1.messageTypeRegistry.set(exports.Account.$type, exports.Account);
|
|
66
|
+
function isSet(value) {
|
|
67
|
+
return value !== null && value !== undefined;
|
|
68
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import { ServerEndpoint } from "../../common/protocol/server_spec";
|
|
3
|
+
import { User } from "../../common/protocol/user";
|
|
3
4
|
export declare const protobufPackage = "xray.proxy.hysteria";
|
|
4
5
|
export interface ClientConfig {
|
|
5
6
|
$type: "xray.proxy.hysteria.ClientConfig";
|
|
6
7
|
version: number;
|
|
7
8
|
server: ServerEndpoint | undefined;
|
|
8
9
|
}
|
|
10
|
+
export interface ServerConfig {
|
|
11
|
+
$type: "xray.proxy.hysteria.ServerConfig";
|
|
12
|
+
users: User[];
|
|
13
|
+
}
|
|
9
14
|
export declare const ClientConfig: MessageFns<ClientConfig, "xray.proxy.hysteria.ClientConfig">;
|
|
15
|
+
export declare const ServerConfig: MessageFns<ServerConfig, "xray.proxy.hysteria.ServerConfig">;
|
|
10
16
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
11
17
|
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 {} ? {
|
|
12
18
|
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/hysteria/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/hysteria/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAGlD,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,kCAAkC,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,kCAAkC,CAAC;IA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CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
// protoc v6.33.4
|
|
6
6
|
// source: proxy/hysteria/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ClientConfig = exports.protobufPackage = void 0;
|
|
8
|
+
exports.ServerConfig = exports.ClientConfig = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const server_spec_1 = require("../../common/protocol/server_spec");
|
|
12
|
+
const user_1 = require("../../common/protocol/user");
|
|
12
13
|
const typeRegistry_1 = require("../../typeRegistry");
|
|
13
14
|
exports.protobufPackage = "xray.proxy.hysteria";
|
|
14
15
|
function createBaseClientConfig() {
|
|
@@ -84,6 +85,62 @@ exports.ClientConfig = {
|
|
|
84
85
|
},
|
|
85
86
|
};
|
|
86
87
|
typeRegistry_1.messageTypeRegistry.set(exports.ClientConfig.$type, exports.ClientConfig);
|
|
88
|
+
function createBaseServerConfig() {
|
|
89
|
+
return { $type: "xray.proxy.hysteria.ServerConfig", users: [] };
|
|
90
|
+
}
|
|
91
|
+
exports.ServerConfig = {
|
|
92
|
+
$type: "xray.proxy.hysteria.ServerConfig",
|
|
93
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
94
|
+
for (const v of message.users) {
|
|
95
|
+
user_1.User.encode(v, writer.uint32(10).fork()).join();
|
|
96
|
+
}
|
|
97
|
+
return writer;
|
|
98
|
+
},
|
|
99
|
+
decode(input, length) {
|
|
100
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
101
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
102
|
+
const message = createBaseServerConfig();
|
|
103
|
+
while (reader.pos < end) {
|
|
104
|
+
const tag = reader.uint32();
|
|
105
|
+
switch (tag >>> 3) {
|
|
106
|
+
case 1: {
|
|
107
|
+
if (tag !== 10) {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
message.users.push(user_1.User.decode(reader, reader.uint32()));
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
reader.skip(tag & 7);
|
|
118
|
+
}
|
|
119
|
+
return message;
|
|
120
|
+
},
|
|
121
|
+
fromJSON(object) {
|
|
122
|
+
return {
|
|
123
|
+
$type: exports.ServerConfig.$type,
|
|
124
|
+
users: globalThis.Array.isArray(object?.users) ? object.users.map((e) => user_1.User.fromJSON(e)) : [],
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
toJSON(message) {
|
|
128
|
+
const obj = {};
|
|
129
|
+
if (message.users?.length) {
|
|
130
|
+
obj.users = message.users.map((e) => user_1.User.toJSON(e));
|
|
131
|
+
}
|
|
132
|
+
return obj;
|
|
133
|
+
},
|
|
134
|
+
create(base) {
|
|
135
|
+
return exports.ServerConfig.fromPartial(base ?? {});
|
|
136
|
+
},
|
|
137
|
+
fromPartial(object) {
|
|
138
|
+
const message = createBaseServerConfig();
|
|
139
|
+
message.users = object.users?.map((e) => user_1.User.fromPartial(e)) || [];
|
|
140
|
+
return message;
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
typeRegistry_1.messageTypeRegistry.set(exports.ServerConfig.$type, exports.ServerConfig);
|
|
87
144
|
function isSet(value) {
|
|
88
145
|
return value !== null && value !== undefined;
|
|
89
146
|
}
|
|
@@ -50,8 +50,30 @@ export interface StreamConfig {
|
|
|
50
50
|
securitySettings: TypedMessage[];
|
|
51
51
|
udpmasks: TypedMessage[];
|
|
52
52
|
tcpmasks: TypedMessage[];
|
|
53
|
+
quicParams: QuicParams | undefined;
|
|
53
54
|
socketSettings: SocketConfig | undefined;
|
|
54
55
|
}
|
|
56
|
+
export interface UdpHop {
|
|
57
|
+
$type: "xray.transport.internet.UdpHop";
|
|
58
|
+
ports: number[];
|
|
59
|
+
intervalMin: number;
|
|
60
|
+
intervalMax: number;
|
|
61
|
+
}
|
|
62
|
+
export interface QuicParams {
|
|
63
|
+
$type: "xray.transport.internet.QuicParams";
|
|
64
|
+
congestion: string;
|
|
65
|
+
brutalUp: number;
|
|
66
|
+
brutalDown: number;
|
|
67
|
+
udpHop: UdpHop | undefined;
|
|
68
|
+
initStreamReceiveWindow: number;
|
|
69
|
+
maxStreamReceiveWindow: number;
|
|
70
|
+
initConnReceiveWindow: number;
|
|
71
|
+
maxConnReceiveWindow: number;
|
|
72
|
+
maxIdleTimeout: number;
|
|
73
|
+
keepAlivePeriod: number;
|
|
74
|
+
disablePathMtuDiscovery: boolean;
|
|
75
|
+
maxIncomingStreams: number;
|
|
76
|
+
}
|
|
55
77
|
export interface ProxyConfig {
|
|
56
78
|
$type: "xray.transport.internet.ProxyConfig";
|
|
57
79
|
tag: string;
|
|
@@ -120,6 +142,8 @@ export interface HappyEyeballsConfig {
|
|
|
120
142
|
}
|
|
121
143
|
export declare const TransportConfig: MessageFns<TransportConfig, "xray.transport.internet.TransportConfig">;
|
|
122
144
|
export declare const StreamConfig: MessageFns<StreamConfig, "xray.transport.internet.StreamConfig">;
|
|
145
|
+
export declare const UdpHop: MessageFns<UdpHop, "xray.transport.internet.UdpHop">;
|
|
146
|
+
export declare const QuicParams: MessageFns<QuicParams, "xray.transport.internet.QuicParams">;
|
|
123
147
|
export declare const ProxyConfig: MessageFns<ProxyConfig, "xray.transport.internet.ProxyConfig">;
|
|
124
148
|
export declare const CustomSockopt: MessageFns<CustomSockopt, "xray.transport.internet.CustomSockopt">;
|
|
125
149
|
export declare const SocketConfig: MessageFns<SocketConfig, "xray.transport.internet.SocketConfig">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src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EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,aAAa,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC/C,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,oBAAY,uBAAuB;IACjC,2BAA2B;IAC3B,GAAG,IAAI;IACP,4BAA4B;IAC5B,MAAM,IAAI;IACV,gCAAgC;IAChC,QAAQ,IAAI;IACZ,YAAY,KAAK;CAClB;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,GAAG,GAAG,uBAAuB,CAgBpF;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,uBAAuB,GAAG,MAAM,CAYrF;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,6CAA6C,CAAC;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAMD,eAAO,MAAM,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,yCAAyC,CA+ElG,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;I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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: transport/internet/config.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.HappyEyeballsConfig = exports.SocketConfig = exports.CustomSockopt = exports.ProxyConfig = exports.StreamConfig = exports.TransportConfig = exports.SocketConfig_TProxyMode = exports.AddressPortStrategy = exports.DomainStrategy = exports.protobufPackage = void 0;
|
|
8
|
+
exports.HappyEyeballsConfig = exports.SocketConfig = exports.CustomSockopt = exports.ProxyConfig = exports.QuicParams = exports.UdpHop = exports.StreamConfig = exports.TransportConfig = exports.SocketConfig_TProxyMode = exports.AddressPortStrategy = exports.DomainStrategy = exports.protobufPackage = void 0;
|
|
9
9
|
exports.domainStrategyFromJSON = domainStrategyFromJSON;
|
|
10
10
|
exports.domainStrategyToJSON = domainStrategyToJSON;
|
|
11
11
|
exports.addressPortStrategyFromJSON = addressPortStrategyFromJSON;
|
|
@@ -292,6 +292,7 @@ function createBaseStreamConfig() {
|
|
|
292
292
|
securitySettings: [],
|
|
293
293
|
udpmasks: [],
|
|
294
294
|
tcpmasks: [],
|
|
295
|
+
quicParams: undefined,
|
|
295
296
|
socketSettings: undefined,
|
|
296
297
|
};
|
|
297
298
|
}
|
|
@@ -322,6 +323,9 @@ exports.StreamConfig = {
|
|
|
322
323
|
for (const v of message.tcpmasks) {
|
|
323
324
|
typed_message_1.TypedMessage.encode(v, writer.uint32(90).fork()).join();
|
|
324
325
|
}
|
|
326
|
+
if (message.quicParams !== undefined) {
|
|
327
|
+
exports.QuicParams.encode(message.quicParams, writer.uint32(98).fork()).join();
|
|
328
|
+
}
|
|
325
329
|
if (message.socketSettings !== undefined) {
|
|
326
330
|
exports.SocketConfig.encode(message.socketSettings, writer.uint32(50).fork()).join();
|
|
327
331
|
}
|
|
@@ -390,6 +394,13 @@ exports.StreamConfig = {
|
|
|
390
394
|
message.tcpmasks.push(typed_message_1.TypedMessage.decode(reader, reader.uint32()));
|
|
391
395
|
continue;
|
|
392
396
|
}
|
|
397
|
+
case 12: {
|
|
398
|
+
if (tag !== 98) {
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
message.quicParams = exports.QuicParams.decode(reader, reader.uint32());
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
393
404
|
case 6: {
|
|
394
405
|
if (tag !== 50) {
|
|
395
406
|
break;
|
|
@@ -436,6 +447,11 @@ exports.StreamConfig = {
|
|
|
436
447
|
tcpmasks: globalThis.Array.isArray(object?.tcpmasks)
|
|
437
448
|
? object.tcpmasks.map((e) => typed_message_1.TypedMessage.fromJSON(e))
|
|
438
449
|
: [],
|
|
450
|
+
quicParams: isSet(object.quicParams)
|
|
451
|
+
? exports.QuicParams.fromJSON(object.quicParams)
|
|
452
|
+
: isSet(object.quic_params)
|
|
453
|
+
? exports.QuicParams.fromJSON(object.quic_params)
|
|
454
|
+
: undefined,
|
|
439
455
|
socketSettings: isSet(object.socketSettings)
|
|
440
456
|
? exports.SocketConfig.fromJSON(object.socketSettings)
|
|
441
457
|
: isSet(object.socket_settings)
|
|
@@ -469,6 +485,9 @@ exports.StreamConfig = {
|
|
|
469
485
|
if (message.tcpmasks?.length) {
|
|
470
486
|
obj.tcpmasks = message.tcpmasks.map((e) => typed_message_1.TypedMessage.toJSON(e));
|
|
471
487
|
}
|
|
488
|
+
if (message.quicParams !== undefined) {
|
|
489
|
+
obj.quicParams = exports.QuicParams.toJSON(message.quicParams);
|
|
490
|
+
}
|
|
472
491
|
if (message.socketSettings !== undefined) {
|
|
473
492
|
obj.socketSettings = exports.SocketConfig.toJSON(message.socketSettings);
|
|
474
493
|
}
|
|
@@ -489,6 +508,9 @@ exports.StreamConfig = {
|
|
|
489
508
|
message.securitySettings = object.securitySettings?.map((e) => typed_message_1.TypedMessage.fromPartial(e)) || [];
|
|
490
509
|
message.udpmasks = object.udpmasks?.map((e) => typed_message_1.TypedMessage.fromPartial(e)) || [];
|
|
491
510
|
message.tcpmasks = object.tcpmasks?.map((e) => typed_message_1.TypedMessage.fromPartial(e)) || [];
|
|
511
|
+
message.quicParams = (object.quicParams !== undefined && object.quicParams !== null)
|
|
512
|
+
? exports.QuicParams.fromPartial(object.quicParams)
|
|
513
|
+
: undefined;
|
|
492
514
|
message.socketSettings = (object.socketSettings !== undefined && object.socketSettings !== null)
|
|
493
515
|
? exports.SocketConfig.fromPartial(object.socketSettings)
|
|
494
516
|
: undefined;
|
|
@@ -496,6 +518,390 @@ exports.StreamConfig = {
|
|
|
496
518
|
},
|
|
497
519
|
};
|
|
498
520
|
typeRegistry_1.messageTypeRegistry.set(exports.StreamConfig.$type, exports.StreamConfig);
|
|
521
|
+
function createBaseUdpHop() {
|
|
522
|
+
return { $type: "xray.transport.internet.UdpHop", ports: [], intervalMin: 0, intervalMax: 0 };
|
|
523
|
+
}
|
|
524
|
+
exports.UdpHop = {
|
|
525
|
+
$type: "xray.transport.internet.UdpHop",
|
|
526
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
527
|
+
writer.uint32(10).fork();
|
|
528
|
+
for (const v of message.ports) {
|
|
529
|
+
writer.uint32(v);
|
|
530
|
+
}
|
|
531
|
+
writer.join();
|
|
532
|
+
if (message.intervalMin !== 0) {
|
|
533
|
+
writer.uint32(16).int64(message.intervalMin);
|
|
534
|
+
}
|
|
535
|
+
if (message.intervalMax !== 0) {
|
|
536
|
+
writer.uint32(24).int64(message.intervalMax);
|
|
537
|
+
}
|
|
538
|
+
return writer;
|
|
539
|
+
},
|
|
540
|
+
decode(input, length) {
|
|
541
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
542
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
543
|
+
const message = createBaseUdpHop();
|
|
544
|
+
while (reader.pos < end) {
|
|
545
|
+
const tag = reader.uint32();
|
|
546
|
+
switch (tag >>> 3) {
|
|
547
|
+
case 1: {
|
|
548
|
+
if (tag === 8) {
|
|
549
|
+
message.ports.push(reader.uint32());
|
|
550
|
+
continue;
|
|
551
|
+
}
|
|
552
|
+
if (tag === 10) {
|
|
553
|
+
const end2 = reader.uint32() + reader.pos;
|
|
554
|
+
while (reader.pos < end2) {
|
|
555
|
+
message.ports.push(reader.uint32());
|
|
556
|
+
}
|
|
557
|
+
continue;
|
|
558
|
+
}
|
|
559
|
+
break;
|
|
560
|
+
}
|
|
561
|
+
case 2: {
|
|
562
|
+
if (tag !== 16) {
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
message.intervalMin = longToNumber(reader.int64());
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
case 3: {
|
|
569
|
+
if (tag !== 24) {
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
message.intervalMax = longToNumber(reader.int64());
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
reader.skip(tag & 7);
|
|
580
|
+
}
|
|
581
|
+
return message;
|
|
582
|
+
},
|
|
583
|
+
fromJSON(object) {
|
|
584
|
+
return {
|
|
585
|
+
$type: exports.UdpHop.$type,
|
|
586
|
+
ports: globalThis.Array.isArray(object?.ports) ? object.ports.map((e) => globalThis.Number(e)) : [],
|
|
587
|
+
intervalMin: isSet(object.intervalMin)
|
|
588
|
+
? globalThis.Number(object.intervalMin)
|
|
589
|
+
: isSet(object.interval_min)
|
|
590
|
+
? globalThis.Number(object.interval_min)
|
|
591
|
+
: 0,
|
|
592
|
+
intervalMax: isSet(object.intervalMax)
|
|
593
|
+
? globalThis.Number(object.intervalMax)
|
|
594
|
+
: isSet(object.interval_max)
|
|
595
|
+
? globalThis.Number(object.interval_max)
|
|
596
|
+
: 0,
|
|
597
|
+
};
|
|
598
|
+
},
|
|
599
|
+
toJSON(message) {
|
|
600
|
+
const obj = {};
|
|
601
|
+
if (message.ports?.length) {
|
|
602
|
+
obj.ports = message.ports.map((e) => Math.round(e));
|
|
603
|
+
}
|
|
604
|
+
if (message.intervalMin !== 0) {
|
|
605
|
+
obj.intervalMin = Math.round(message.intervalMin);
|
|
606
|
+
}
|
|
607
|
+
if (message.intervalMax !== 0) {
|
|
608
|
+
obj.intervalMax = Math.round(message.intervalMax);
|
|
609
|
+
}
|
|
610
|
+
return obj;
|
|
611
|
+
},
|
|
612
|
+
create(base) {
|
|
613
|
+
return exports.UdpHop.fromPartial(base ?? {});
|
|
614
|
+
},
|
|
615
|
+
fromPartial(object) {
|
|
616
|
+
const message = createBaseUdpHop();
|
|
617
|
+
message.ports = object.ports?.map((e) => e) || [];
|
|
618
|
+
message.intervalMin = object.intervalMin ?? 0;
|
|
619
|
+
message.intervalMax = object.intervalMax ?? 0;
|
|
620
|
+
return message;
|
|
621
|
+
},
|
|
622
|
+
};
|
|
623
|
+
typeRegistry_1.messageTypeRegistry.set(exports.UdpHop.$type, exports.UdpHop);
|
|
624
|
+
function createBaseQuicParams() {
|
|
625
|
+
return {
|
|
626
|
+
$type: "xray.transport.internet.QuicParams",
|
|
627
|
+
congestion: "",
|
|
628
|
+
brutalUp: 0,
|
|
629
|
+
brutalDown: 0,
|
|
630
|
+
udpHop: undefined,
|
|
631
|
+
initStreamReceiveWindow: 0,
|
|
632
|
+
maxStreamReceiveWindow: 0,
|
|
633
|
+
initConnReceiveWindow: 0,
|
|
634
|
+
maxConnReceiveWindow: 0,
|
|
635
|
+
maxIdleTimeout: 0,
|
|
636
|
+
keepAlivePeriod: 0,
|
|
637
|
+
disablePathMtuDiscovery: false,
|
|
638
|
+
maxIncomingStreams: 0,
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
exports.QuicParams = {
|
|
642
|
+
$type: "xray.transport.internet.QuicParams",
|
|
643
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
644
|
+
if (message.congestion !== "") {
|
|
645
|
+
writer.uint32(10).string(message.congestion);
|
|
646
|
+
}
|
|
647
|
+
if (message.brutalUp !== 0) {
|
|
648
|
+
writer.uint32(16).uint64(message.brutalUp);
|
|
649
|
+
}
|
|
650
|
+
if (message.brutalDown !== 0) {
|
|
651
|
+
writer.uint32(24).uint64(message.brutalDown);
|
|
652
|
+
}
|
|
653
|
+
if (message.udpHop !== undefined) {
|
|
654
|
+
exports.UdpHop.encode(message.udpHop, writer.uint32(34).fork()).join();
|
|
655
|
+
}
|
|
656
|
+
if (message.initStreamReceiveWindow !== 0) {
|
|
657
|
+
writer.uint32(40).uint64(message.initStreamReceiveWindow);
|
|
658
|
+
}
|
|
659
|
+
if (message.maxStreamReceiveWindow !== 0) {
|
|
660
|
+
writer.uint32(48).uint64(message.maxStreamReceiveWindow);
|
|
661
|
+
}
|
|
662
|
+
if (message.initConnReceiveWindow !== 0) {
|
|
663
|
+
writer.uint32(56).uint64(message.initConnReceiveWindow);
|
|
664
|
+
}
|
|
665
|
+
if (message.maxConnReceiveWindow !== 0) {
|
|
666
|
+
writer.uint32(64).uint64(message.maxConnReceiveWindow);
|
|
667
|
+
}
|
|
668
|
+
if (message.maxIdleTimeout !== 0) {
|
|
669
|
+
writer.uint32(72).int64(message.maxIdleTimeout);
|
|
670
|
+
}
|
|
671
|
+
if (message.keepAlivePeriod !== 0) {
|
|
672
|
+
writer.uint32(80).int64(message.keepAlivePeriod);
|
|
673
|
+
}
|
|
674
|
+
if (message.disablePathMtuDiscovery !== false) {
|
|
675
|
+
writer.uint32(88).bool(message.disablePathMtuDiscovery);
|
|
676
|
+
}
|
|
677
|
+
if (message.maxIncomingStreams !== 0) {
|
|
678
|
+
writer.uint32(96).int64(message.maxIncomingStreams);
|
|
679
|
+
}
|
|
680
|
+
return writer;
|
|
681
|
+
},
|
|
682
|
+
decode(input, length) {
|
|
683
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
684
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
685
|
+
const message = createBaseQuicParams();
|
|
686
|
+
while (reader.pos < end) {
|
|
687
|
+
const tag = reader.uint32();
|
|
688
|
+
switch (tag >>> 3) {
|
|
689
|
+
case 1: {
|
|
690
|
+
if (tag !== 10) {
|
|
691
|
+
break;
|
|
692
|
+
}
|
|
693
|
+
message.congestion = reader.string();
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
case 2: {
|
|
697
|
+
if (tag !== 16) {
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
message.brutalUp = longToNumber(reader.uint64());
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
case 3: {
|
|
704
|
+
if (tag !== 24) {
|
|
705
|
+
break;
|
|
706
|
+
}
|
|
707
|
+
message.brutalDown = longToNumber(reader.uint64());
|
|
708
|
+
continue;
|
|
709
|
+
}
|
|
710
|
+
case 4: {
|
|
711
|
+
if (tag !== 34) {
|
|
712
|
+
break;
|
|
713
|
+
}
|
|
714
|
+
message.udpHop = exports.UdpHop.decode(reader, reader.uint32());
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
case 5: {
|
|
718
|
+
if (tag !== 40) {
|
|
719
|
+
break;
|
|
720
|
+
}
|
|
721
|
+
message.initStreamReceiveWindow = longToNumber(reader.uint64());
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
case 6: {
|
|
725
|
+
if (tag !== 48) {
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
message.maxStreamReceiveWindow = longToNumber(reader.uint64());
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
case 7: {
|
|
732
|
+
if (tag !== 56) {
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
message.initConnReceiveWindow = longToNumber(reader.uint64());
|
|
736
|
+
continue;
|
|
737
|
+
}
|
|
738
|
+
case 8: {
|
|
739
|
+
if (tag !== 64) {
|
|
740
|
+
break;
|
|
741
|
+
}
|
|
742
|
+
message.maxConnReceiveWindow = longToNumber(reader.uint64());
|
|
743
|
+
continue;
|
|
744
|
+
}
|
|
745
|
+
case 9: {
|
|
746
|
+
if (tag !== 72) {
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
message.maxIdleTimeout = longToNumber(reader.int64());
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
case 10: {
|
|
753
|
+
if (tag !== 80) {
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
message.keepAlivePeriod = longToNumber(reader.int64());
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
759
|
+
case 11: {
|
|
760
|
+
if (tag !== 88) {
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
message.disablePathMtuDiscovery = reader.bool();
|
|
764
|
+
continue;
|
|
765
|
+
}
|
|
766
|
+
case 12: {
|
|
767
|
+
if (tag !== 96) {
|
|
768
|
+
break;
|
|
769
|
+
}
|
|
770
|
+
message.maxIncomingStreams = longToNumber(reader.int64());
|
|
771
|
+
continue;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
reader.skip(tag & 7);
|
|
778
|
+
}
|
|
779
|
+
return message;
|
|
780
|
+
},
|
|
781
|
+
fromJSON(object) {
|
|
782
|
+
return {
|
|
783
|
+
$type: exports.QuicParams.$type,
|
|
784
|
+
congestion: isSet(object.congestion) ? globalThis.String(object.congestion) : "",
|
|
785
|
+
brutalUp: isSet(object.brutalUp)
|
|
786
|
+
? globalThis.Number(object.brutalUp)
|
|
787
|
+
: isSet(object.brutal_up)
|
|
788
|
+
? globalThis.Number(object.brutal_up)
|
|
789
|
+
: 0,
|
|
790
|
+
brutalDown: isSet(object.brutalDown)
|
|
791
|
+
? globalThis.Number(object.brutalDown)
|
|
792
|
+
: isSet(object.brutal_down)
|
|
793
|
+
? globalThis.Number(object.brutal_down)
|
|
794
|
+
: 0,
|
|
795
|
+
udpHop: isSet(object.udpHop)
|
|
796
|
+
? exports.UdpHop.fromJSON(object.udpHop)
|
|
797
|
+
: isSet(object.udp_hop)
|
|
798
|
+
? exports.UdpHop.fromJSON(object.udp_hop)
|
|
799
|
+
: undefined,
|
|
800
|
+
initStreamReceiveWindow: isSet(object.initStreamReceiveWindow)
|
|
801
|
+
? globalThis.Number(object.initStreamReceiveWindow)
|
|
802
|
+
: isSet(object.init_stream_receive_window)
|
|
803
|
+
? globalThis.Number(object.init_stream_receive_window)
|
|
804
|
+
: 0,
|
|
805
|
+
maxStreamReceiveWindow: isSet(object.maxStreamReceiveWindow)
|
|
806
|
+
? globalThis.Number(object.maxStreamReceiveWindow)
|
|
807
|
+
: isSet(object.max_stream_receive_window)
|
|
808
|
+
? globalThis.Number(object.max_stream_receive_window)
|
|
809
|
+
: 0,
|
|
810
|
+
initConnReceiveWindow: isSet(object.initConnReceiveWindow)
|
|
811
|
+
? globalThis.Number(object.initConnReceiveWindow)
|
|
812
|
+
: isSet(object.init_conn_receive_window)
|
|
813
|
+
? globalThis.Number(object.init_conn_receive_window)
|
|
814
|
+
: 0,
|
|
815
|
+
maxConnReceiveWindow: isSet(object.maxConnReceiveWindow)
|
|
816
|
+
? globalThis.Number(object.maxConnReceiveWindow)
|
|
817
|
+
: isSet(object.max_conn_receive_window)
|
|
818
|
+
? globalThis.Number(object.max_conn_receive_window)
|
|
819
|
+
: 0,
|
|
820
|
+
maxIdleTimeout: isSet(object.maxIdleTimeout)
|
|
821
|
+
? globalThis.Number(object.maxIdleTimeout)
|
|
822
|
+
: isSet(object.max_idle_timeout)
|
|
823
|
+
? globalThis.Number(object.max_idle_timeout)
|
|
824
|
+
: 0,
|
|
825
|
+
keepAlivePeriod: isSet(object.keepAlivePeriod)
|
|
826
|
+
? globalThis.Number(object.keepAlivePeriod)
|
|
827
|
+
: isSet(object.keep_alive_period)
|
|
828
|
+
? globalThis.Number(object.keep_alive_period)
|
|
829
|
+
: 0,
|
|
830
|
+
disablePathMtuDiscovery: isSet(object.disablePathMtuDiscovery)
|
|
831
|
+
? globalThis.Boolean(object.disablePathMtuDiscovery)
|
|
832
|
+
: isSet(object.disable_path_mtu_discovery)
|
|
833
|
+
? globalThis.Boolean(object.disable_path_mtu_discovery)
|
|
834
|
+
: false,
|
|
835
|
+
maxIncomingStreams: isSet(object.maxIncomingStreams)
|
|
836
|
+
? globalThis.Number(object.maxIncomingStreams)
|
|
837
|
+
: isSet(object.max_incoming_streams)
|
|
838
|
+
? globalThis.Number(object.max_incoming_streams)
|
|
839
|
+
: 0,
|
|
840
|
+
};
|
|
841
|
+
},
|
|
842
|
+
toJSON(message) {
|
|
843
|
+
const obj = {};
|
|
844
|
+
if (message.congestion !== "") {
|
|
845
|
+
obj.congestion = message.congestion;
|
|
846
|
+
}
|
|
847
|
+
if (message.brutalUp !== 0) {
|
|
848
|
+
obj.brutalUp = Math.round(message.brutalUp);
|
|
849
|
+
}
|
|
850
|
+
if (message.brutalDown !== 0) {
|
|
851
|
+
obj.brutalDown = Math.round(message.brutalDown);
|
|
852
|
+
}
|
|
853
|
+
if (message.udpHop !== undefined) {
|
|
854
|
+
obj.udpHop = exports.UdpHop.toJSON(message.udpHop);
|
|
855
|
+
}
|
|
856
|
+
if (message.initStreamReceiveWindow !== 0) {
|
|
857
|
+
obj.initStreamReceiveWindow = Math.round(message.initStreamReceiveWindow);
|
|
858
|
+
}
|
|
859
|
+
if (message.maxStreamReceiveWindow !== 0) {
|
|
860
|
+
obj.maxStreamReceiveWindow = Math.round(message.maxStreamReceiveWindow);
|
|
861
|
+
}
|
|
862
|
+
if (message.initConnReceiveWindow !== 0) {
|
|
863
|
+
obj.initConnReceiveWindow = Math.round(message.initConnReceiveWindow);
|
|
864
|
+
}
|
|
865
|
+
if (message.maxConnReceiveWindow !== 0) {
|
|
866
|
+
obj.maxConnReceiveWindow = Math.round(message.maxConnReceiveWindow);
|
|
867
|
+
}
|
|
868
|
+
if (message.maxIdleTimeout !== 0) {
|
|
869
|
+
obj.maxIdleTimeout = Math.round(message.maxIdleTimeout);
|
|
870
|
+
}
|
|
871
|
+
if (message.keepAlivePeriod !== 0) {
|
|
872
|
+
obj.keepAlivePeriod = Math.round(message.keepAlivePeriod);
|
|
873
|
+
}
|
|
874
|
+
if (message.disablePathMtuDiscovery !== false) {
|
|
875
|
+
obj.disablePathMtuDiscovery = message.disablePathMtuDiscovery;
|
|
876
|
+
}
|
|
877
|
+
if (message.maxIncomingStreams !== 0) {
|
|
878
|
+
obj.maxIncomingStreams = Math.round(message.maxIncomingStreams);
|
|
879
|
+
}
|
|
880
|
+
return obj;
|
|
881
|
+
},
|
|
882
|
+
create(base) {
|
|
883
|
+
return exports.QuicParams.fromPartial(base ?? {});
|
|
884
|
+
},
|
|
885
|
+
fromPartial(object) {
|
|
886
|
+
const message = createBaseQuicParams();
|
|
887
|
+
message.congestion = object.congestion ?? "";
|
|
888
|
+
message.brutalUp = object.brutalUp ?? 0;
|
|
889
|
+
message.brutalDown = object.brutalDown ?? 0;
|
|
890
|
+
message.udpHop = (object.udpHop !== undefined && object.udpHop !== null)
|
|
891
|
+
? exports.UdpHop.fromPartial(object.udpHop)
|
|
892
|
+
: undefined;
|
|
893
|
+
message.initStreamReceiveWindow = object.initStreamReceiveWindow ?? 0;
|
|
894
|
+
message.maxStreamReceiveWindow = object.maxStreamReceiveWindow ?? 0;
|
|
895
|
+
message.initConnReceiveWindow = object.initConnReceiveWindow ?? 0;
|
|
896
|
+
message.maxConnReceiveWindow = object.maxConnReceiveWindow ?? 0;
|
|
897
|
+
message.maxIdleTimeout = object.maxIdleTimeout ?? 0;
|
|
898
|
+
message.keepAlivePeriod = object.keepAlivePeriod ?? 0;
|
|
899
|
+
message.disablePathMtuDiscovery = object.disablePathMtuDiscovery ?? false;
|
|
900
|
+
message.maxIncomingStreams = object.maxIncomingStreams ?? 0;
|
|
901
|
+
return message;
|
|
902
|
+
},
|
|
903
|
+
};
|
|
904
|
+
typeRegistry_1.messageTypeRegistry.set(exports.QuicParams.$type, exports.QuicParams);
|
|
499
905
|
function createBaseProxyConfig() {
|
|
500
906
|
return { $type: "xray.transport.internet.ProxyConfig", tag: "", transportLayerProxy: false };
|
|
501
907
|
}
|