@remnawave/xtls-sdk 0.12.5 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/build/src/router/interfaces/index.d.ts +0 -1
- package/build/src/router/interfaces/index.d.ts.map +1 -1
- package/build/src/router/interfaces/index.js +0 -1
- package/build/src/router/models/index.d.ts +0 -1
- package/build/src/router/models/index.d.ts.map +1 -1
- package/build/src/router/models/index.js +0 -1
- package/build/src/router/router.service.d.ts +2 -12
- package/build/src/router/router.service.d.ts.map +1 -1
- package/build/src/router/router.service.js +1 -57
- package/build/src/xray-protos/app/geodata/config.d.ts +30 -0
- package/build/src/xray-protos/app/geodata/config.d.ts.map +1 -0
- package/build/src/xray-protos/app/geodata/config.js +172 -0
- package/build/src/xray-protos/app/proxyman/config.d.ts +3 -1
- package/build/src/xray-protos/app/proxyman/config.d.ts.map +1 -1
- package/build/src/xray-protos/app/proxyman/config.js +27 -6
- package/build/src/xray-protos/common/geodata/geodat.d.ts +111 -0
- package/build/src/xray-protos/common/geodata/geodat.d.ts.map +1 -0
- package/build/src/xray-protos/common/geodata/geodat.js +1027 -0
- package/build/src/xray-protos/proxy/dns/config.d.ts +19 -7
- package/build/src/xray-protos/proxy/dns/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/dns/config.js +161 -52
- package/build/src/xray-protos/proxy/freedom/config.d.ts +26 -0
- package/build/src/xray-protos/proxy/freedom/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/freedom/config.js +272 -1
- package/build/src/xray-protos/proxy/tun/config.d.ts +4 -0
- package/build/src/xray-protos/proxy/tun/config.d.ts.map +1 -1
- package/build/src/xray-protos/proxy/tun/config.js +80 -3
- package/build/src/xray-protos/transport/internet/config.d.ts +0 -2
- package/build/src/xray-protos/transport/internet/config.d.ts.map +1 -1
- package/build/src/xray-protos/transport/internet/config.js +0 -65
- package/package.json +3 -4
- package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts +0 -7
- package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts.map +0 -1
- package/build/src/router/interfaces/add-source-ip-rule.interface.js +0 -2
- package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts +0 -5
- package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts.map +0 -1
- package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.js +0 -9
- package/build/src/router/models/add-source-ip-rule/index.d.ts +0 -2
- package/build/src/router/models/add-source-ip-rule/index.d.ts.map +0 -1
- package/build/src/router/models/add-source-ip-rule/index.js +0 -17
- package/build/src/xray-protos/app/router/config.d.ts +0 -193
- package/build/src/xray-protos/app/router/config.d.ts.map +0 -1
- package/build/src/xray-protos/app/router/config.js +0 -1797
package/README.md
CHANGED
|
@@ -41,7 +41,9 @@ pnpm add @remnawave/xtls-sdk
|
|
|
41
41
|
import { XtlsApi } from '@remnawave/xtls-sdk';
|
|
42
42
|
|
|
43
43
|
// Initialize the API client
|
|
44
|
-
const api = new XtlsApi(
|
|
44
|
+
const api = new XtlsApi({
|
|
45
|
+
connectionUrl: '127.0.0.1:10085',
|
|
46
|
+
});
|
|
45
47
|
|
|
46
48
|
// Example: Get system statistics
|
|
47
49
|
const stats = await api.stats.getSysStats();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/router/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/router/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
|
@@ -14,5 +14,4 @@ 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-source-ip-rule.interface"), exports);
|
|
18
17
|
__exportStar(require("./remove-rule-by-rule-tag.interface"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/router/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/router/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -14,5 +14,4 @@ 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-source-ip-rule"), exports);
|
|
18
17
|
__exportStar(require("./remove-rule-by-rule-tag"), exports);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Channel } from 'nice-grpc';
|
|
2
2
|
import { RoutingServiceClient } from '../xray-protos/app/router/command/command';
|
|
3
|
-
import {
|
|
4
|
-
import { IAddSourceIpRule, IRemoveRuleByRuleTag } from './interfaces';
|
|
3
|
+
import { RemoveRuleByRuleTagResponseModel } from './models';
|
|
5
4
|
import { ISdkResponse } from '../common/types/sdk-response';
|
|
5
|
+
import { IRemoveRuleByRuleTag } from './interfaces';
|
|
6
6
|
/**
|
|
7
7
|
* Service for managing routing rules in XRAY/XTLS
|
|
8
8
|
* RoutingService is required (enable on XRay Config) to add/remove routing rules.
|
|
@@ -15,16 +15,6 @@ export declare class RouterService {
|
|
|
15
15
|
* @param channel - The gRPC channel to use for communication
|
|
16
16
|
*/
|
|
17
17
|
constructor(channel: Channel);
|
|
18
|
-
/**
|
|
19
|
-
* Adds a new routing rule based on source IP address
|
|
20
|
-
* @param dto - Data transfer object containing rule configuration
|
|
21
|
-
* @param dto.ruleTag - Unique identifier for the rule
|
|
22
|
-
* @param dto.outbound - Outbound tag to route matched traffic
|
|
23
|
-
* @param dto.ip - Source IP address to match
|
|
24
|
-
* @param dto.append - Whether to append the rule or replace existing rules
|
|
25
|
-
* @returns Promise resolving to response indicating success or failure
|
|
26
|
-
*/
|
|
27
|
-
addSrcIpRule(dto: IAddSourceIpRule): Promise<ISdkResponse<AddSourceIpRuleResponseModel>>;
|
|
28
18
|
/**
|
|
29
19
|
* Removes a routing rule by its tag
|
|
30
20
|
* @param dto - Data transfer object containing rule tag
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.service.d.ts","sourceRoot":"","sources":["../../../src/router/router.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"router.service.d.ts","sourceRoot":"","sources":["../../../src/router/router.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAC;AAElD,OAAO,EACH,oBAAoB,EAEvB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD;;;GAGG;AACH,qBAAa,aAAa;IAOV,OAAO,CAAC,QAAQ,CAAC,OAAO;IANpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAE9C;;;OAGG;gBAC0B,OAAO,EAAE,OAAO;IAI7C;;;;;OAKG;IACU,mBAAmB,CAC5B,GAAG,EAAE,oBAAoB,GAC1B,OAAO,CAAC,YAAY,CAAC,gCAAgC,CAAC,CAAC;IAsB1D;;;OAGG;IACH,IAAW,SAAS,IAAI,oBAAoB,CAE3C;CACJ"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.RouterService = void 0;
|
|
7
4
|
const nice_grpc_1 = require("nice-grpc");
|
|
8
|
-
const ipaddr_js_1 = __importDefault(require("ipaddr.js"));
|
|
9
5
|
const command_1 = require("../xray-protos/app/router/command/command");
|
|
10
|
-
const create_typed_message_1 = __importDefault(require("../common/utils/create-typed-message/create-typed-message"));
|
|
11
|
-
const models_1 = require("./models");
|
|
12
|
-
const config_1 = require("../xray-protos/app/router/config");
|
|
13
6
|
const router_errors_1 = require("../common/errors/router/router.errors");
|
|
7
|
+
const models_1 = require("./models");
|
|
14
8
|
/**
|
|
15
9
|
* Service for managing routing rules in XRAY/XTLS
|
|
16
10
|
* RoutingService is required (enable on XRay Config) to add/remove routing rules.
|
|
@@ -24,56 +18,6 @@ class RouterService {
|
|
|
24
18
|
this.channel = channel;
|
|
25
19
|
this.client = (0, nice_grpc_1.createClient)(command_1.RoutingServiceDefinition, channel);
|
|
26
20
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Adds a new routing rule based on source IP address
|
|
29
|
-
* @param dto - Data transfer object containing rule configuration
|
|
30
|
-
* @param dto.ruleTag - Unique identifier for the rule
|
|
31
|
-
* @param dto.outbound - Outbound tag to route matched traffic
|
|
32
|
-
* @param dto.ip - Source IP address to match
|
|
33
|
-
* @param dto.append - Whether to append the rule or replace existing rules
|
|
34
|
-
* @returns Promise resolving to response indicating success or failure
|
|
35
|
-
*/
|
|
36
|
-
async addSrcIpRule(dto) {
|
|
37
|
-
try {
|
|
38
|
-
const ip = ipaddr_js_1.default.parse(dto.ip);
|
|
39
|
-
const prefix = ip.kind() === 'ipv6' ? 128 : 32;
|
|
40
|
-
await this.client.addRule({
|
|
41
|
-
config: (0, create_typed_message_1.default)(config_1.Config, {
|
|
42
|
-
rule: [
|
|
43
|
-
{
|
|
44
|
-
ruleTag: dto.ruleTag,
|
|
45
|
-
tag: dto.outbound,
|
|
46
|
-
sourceGeoip: [
|
|
47
|
-
config_1.GeoIP.fromPartial({
|
|
48
|
-
cidr: [
|
|
49
|
-
config_1.CIDR.fromPartial({
|
|
50
|
-
ip: new Uint8Array(ip.toByteArray()),
|
|
51
|
-
prefix,
|
|
52
|
-
}),
|
|
53
|
-
],
|
|
54
|
-
}),
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
}),
|
|
59
|
-
shouldAppend: dto.append,
|
|
60
|
-
});
|
|
61
|
-
return {
|
|
62
|
-
isOk: true,
|
|
63
|
-
data: new models_1.AddSourceIpRuleResponseModel(true),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
let message = '';
|
|
68
|
-
if (error instanceof Error) {
|
|
69
|
-
message = error.message;
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
isOk: false,
|
|
73
|
-
...router_errors_1.ROUTER_ERRORS.ADD_SOURCE_IP_RULE_ERROR(message),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
21
|
/**
|
|
78
22
|
* Removes a routing rule by its tag
|
|
79
23
|
* @param dto - Data transfer object containing rule tag
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "xray.app.geodata";
|
|
3
|
+
export interface Asset {
|
|
4
|
+
$type: "xray.app.geodata.Asset";
|
|
5
|
+
url: string;
|
|
6
|
+
file: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Config {
|
|
9
|
+
$type: "xray.app.geodata.Config";
|
|
10
|
+
cron: string;
|
|
11
|
+
outbound: string;
|
|
12
|
+
assets: Asset[];
|
|
13
|
+
}
|
|
14
|
+
export declare const Asset: MessageFns<Asset, "xray.app.geodata.Asset">;
|
|
15
|
+
export declare const Config: MessageFns<Config, "xray.app.geodata.Config">;
|
|
16
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
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 {} ? {
|
|
18
|
+
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
19
|
+
} : Partial<T>;
|
|
20
|
+
export interface MessageFns<T, V extends string> {
|
|
21
|
+
readonly $type: V;
|
|
22
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
23
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
24
|
+
fromJSON(object: any): T;
|
|
25
|
+
toJSON(message: T): unknown;
|
|
26
|
+
create(base?: DeepPartial<T>): T;
|
|
27
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/app/geodata/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAElD,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,wBAAwB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,yBAAyB,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAMD,eAAO,MAAM,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,wBAAwB,CAyE7D,CAAC;AAQF,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,yBAAyB,CAyFhE,CAAC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O NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.2
|
|
5
|
+
// protoc v6.33.4
|
|
6
|
+
// source: app/geodata/config.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Config = exports.Asset = 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.app.geodata";
|
|
13
|
+
function createBaseAsset() {
|
|
14
|
+
return { $type: "xray.app.geodata.Asset", url: "", file: "" };
|
|
15
|
+
}
|
|
16
|
+
exports.Asset = {
|
|
17
|
+
$type: "xray.app.geodata.Asset",
|
|
18
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
19
|
+
if (message.url !== "") {
|
|
20
|
+
writer.uint32(10).string(message.url);
|
|
21
|
+
}
|
|
22
|
+
if (message.file !== "") {
|
|
23
|
+
writer.uint32(18).string(message.file);
|
|
24
|
+
}
|
|
25
|
+
return writer;
|
|
26
|
+
},
|
|
27
|
+
decode(input, length) {
|
|
28
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
29
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
30
|
+
const message = createBaseAsset();
|
|
31
|
+
while (reader.pos < end) {
|
|
32
|
+
const tag = reader.uint32();
|
|
33
|
+
switch (tag >>> 3) {
|
|
34
|
+
case 1: {
|
|
35
|
+
if (tag !== 10) {
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
message.url = reader.string();
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
case 2: {
|
|
42
|
+
if (tag !== 18) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
message.file = reader.string();
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
reader.skip(tag & 7);
|
|
53
|
+
}
|
|
54
|
+
return message;
|
|
55
|
+
},
|
|
56
|
+
fromJSON(object) {
|
|
57
|
+
return {
|
|
58
|
+
$type: exports.Asset.$type,
|
|
59
|
+
url: isSet(object.url) ? globalThis.String(object.url) : "",
|
|
60
|
+
file: isSet(object.file) ? globalThis.String(object.file) : "",
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
toJSON(message) {
|
|
64
|
+
const obj = {};
|
|
65
|
+
if (message.url !== "") {
|
|
66
|
+
obj.url = message.url;
|
|
67
|
+
}
|
|
68
|
+
if (message.file !== "") {
|
|
69
|
+
obj.file = message.file;
|
|
70
|
+
}
|
|
71
|
+
return obj;
|
|
72
|
+
},
|
|
73
|
+
create(base) {
|
|
74
|
+
return exports.Asset.fromPartial(base ?? {});
|
|
75
|
+
},
|
|
76
|
+
fromPartial(object) {
|
|
77
|
+
const message = createBaseAsset();
|
|
78
|
+
message.url = object.url ?? "";
|
|
79
|
+
message.file = object.file ?? "";
|
|
80
|
+
return message;
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
typeRegistry_1.messageTypeRegistry.set(exports.Asset.$type, exports.Asset);
|
|
84
|
+
function createBaseConfig() {
|
|
85
|
+
return { $type: "xray.app.geodata.Config", cron: "", outbound: "", assets: [] };
|
|
86
|
+
}
|
|
87
|
+
exports.Config = {
|
|
88
|
+
$type: "xray.app.geodata.Config",
|
|
89
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
90
|
+
if (message.cron !== "") {
|
|
91
|
+
writer.uint32(10).string(message.cron);
|
|
92
|
+
}
|
|
93
|
+
if (message.outbound !== "") {
|
|
94
|
+
writer.uint32(18).string(message.outbound);
|
|
95
|
+
}
|
|
96
|
+
for (const v of message.assets) {
|
|
97
|
+
exports.Asset.encode(v, writer.uint32(26).fork()).join();
|
|
98
|
+
}
|
|
99
|
+
return writer;
|
|
100
|
+
},
|
|
101
|
+
decode(input, length) {
|
|
102
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
103
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
104
|
+
const message = createBaseConfig();
|
|
105
|
+
while (reader.pos < end) {
|
|
106
|
+
const tag = reader.uint32();
|
|
107
|
+
switch (tag >>> 3) {
|
|
108
|
+
case 1: {
|
|
109
|
+
if (tag !== 10) {
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
message.cron = reader.string();
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
case 2: {
|
|
116
|
+
if (tag !== 18) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
message.outbound = reader.string();
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
case 3: {
|
|
123
|
+
if (tag !== 26) {
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
message.assets.push(exports.Asset.decode(reader, reader.uint32()));
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
reader.skip(tag & 7);
|
|
134
|
+
}
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
fromJSON(object) {
|
|
138
|
+
return {
|
|
139
|
+
$type: exports.Config.$type,
|
|
140
|
+
cron: isSet(object.cron) ? globalThis.String(object.cron) : "",
|
|
141
|
+
outbound: isSet(object.outbound) ? globalThis.String(object.outbound) : "",
|
|
142
|
+
assets: globalThis.Array.isArray(object?.assets) ? object.assets.map((e) => exports.Asset.fromJSON(e)) : [],
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
toJSON(message) {
|
|
146
|
+
const obj = {};
|
|
147
|
+
if (message.cron !== "") {
|
|
148
|
+
obj.cron = message.cron;
|
|
149
|
+
}
|
|
150
|
+
if (message.outbound !== "") {
|
|
151
|
+
obj.outbound = message.outbound;
|
|
152
|
+
}
|
|
153
|
+
if (message.assets?.length) {
|
|
154
|
+
obj.assets = message.assets.map((e) => exports.Asset.toJSON(e));
|
|
155
|
+
}
|
|
156
|
+
return obj;
|
|
157
|
+
},
|
|
158
|
+
create(base) {
|
|
159
|
+
return exports.Config.fromPartial(base ?? {});
|
|
160
|
+
},
|
|
161
|
+
fromPartial(object) {
|
|
162
|
+
const message = createBaseConfig();
|
|
163
|
+
message.cron = object.cron ?? "";
|
|
164
|
+
message.outbound = object.outbound ?? "";
|
|
165
|
+
message.assets = object.assets?.map((e) => exports.Asset.fromPartial(e)) || [];
|
|
166
|
+
return message;
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
|
|
170
|
+
function isSet(value) {
|
|
171
|
+
return value !== null && value !== undefined;
|
|
172
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { DomainRule, IPRule } from "../../common/geodata/geodat";
|
|
2
3
|
import { IPOrDomain } from "../../common/net/address";
|
|
3
4
|
import { PortList } from "../../common/net/port";
|
|
4
5
|
import { TypedMessage } from "../../common/serial/typed_message";
|
|
@@ -16,7 +17,8 @@ export interface SniffingConfig {
|
|
|
16
17
|
* Supported values are "http", "tls", "fakedns".
|
|
17
18
|
*/
|
|
18
19
|
destinationOverride: string[];
|
|
19
|
-
domainsExcluded:
|
|
20
|
+
domainsExcluded: DomainRule[];
|
|
21
|
+
ipsExcluded: IPRule[];
|
|
20
22
|
/**
|
|
21
23
|
* Whether should only try to sniff metadata without waiting for client input.
|
|
22
24
|
* Can be used to support SMTP like protocol where server send the first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/app/proxyman/config.ts"],"names":[],"mappings":"AAOA,O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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"}
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.MultiplexingConfig = exports.SenderConfig = exports.OutboundConfig = exports.InboundHandlerConfig = exports.ReceiverConfig = exports.SniffingConfig = exports.InboundConfig = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const geodat_1 = require("../../common/geodata/geodat");
|
|
11
12
|
const address_1 = require("../../common/net/address");
|
|
12
13
|
const port_1 = require("../../common/net/port");
|
|
13
14
|
const typed_message_1 = require("../../common/serial/typed_message");
|
|
@@ -59,6 +60,7 @@ function createBaseSniffingConfig() {
|
|
|
59
60
|
enabled: false,
|
|
60
61
|
destinationOverride: [],
|
|
61
62
|
domainsExcluded: [],
|
|
63
|
+
ipsExcluded: [],
|
|
62
64
|
metadataOnly: false,
|
|
63
65
|
routeOnly: false,
|
|
64
66
|
};
|
|
@@ -73,7 +75,10 @@ exports.SniffingConfig = {
|
|
|
73
75
|
writer.uint32(18).string(v);
|
|
74
76
|
}
|
|
75
77
|
for (const v of message.domainsExcluded) {
|
|
76
|
-
writer.uint32(26).
|
|
78
|
+
geodat_1.DomainRule.encode(v, writer.uint32(26).fork()).join();
|
|
79
|
+
}
|
|
80
|
+
for (const v of message.ipsExcluded) {
|
|
81
|
+
geodat_1.IPRule.encode(v, writer.uint32(50).fork()).join();
|
|
77
82
|
}
|
|
78
83
|
if (message.metadataOnly !== false) {
|
|
79
84
|
writer.uint32(32).bool(message.metadataOnly);
|
|
@@ -108,7 +113,14 @@ exports.SniffingConfig = {
|
|
|
108
113
|
if (tag !== 26) {
|
|
109
114
|
break;
|
|
110
115
|
}
|
|
111
|
-
message.domainsExcluded.push(reader.
|
|
116
|
+
message.domainsExcluded.push(geodat_1.DomainRule.decode(reader, reader.uint32()));
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
case 6: {
|
|
120
|
+
if (tag !== 50) {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
message.ipsExcluded.push(geodat_1.IPRule.decode(reader, reader.uint32()));
|
|
112
124
|
continue;
|
|
113
125
|
}
|
|
114
126
|
case 4: {
|
|
@@ -143,9 +155,14 @@ exports.SniffingConfig = {
|
|
|
143
155
|
? object.destination_override.map((e) => globalThis.String(e))
|
|
144
156
|
: [],
|
|
145
157
|
domainsExcluded: globalThis.Array.isArray(object?.domainsExcluded)
|
|
146
|
-
? object.domainsExcluded.map((e) =>
|
|
158
|
+
? object.domainsExcluded.map((e) => geodat_1.DomainRule.fromJSON(e))
|
|
147
159
|
: globalThis.Array.isArray(object?.domains_excluded)
|
|
148
|
-
? object.domains_excluded.map((e) =>
|
|
160
|
+
? object.domains_excluded.map((e) => geodat_1.DomainRule.fromJSON(e))
|
|
161
|
+
: [],
|
|
162
|
+
ipsExcluded: globalThis.Array.isArray(object?.ipsExcluded)
|
|
163
|
+
? object.ipsExcluded.map((e) => geodat_1.IPRule.fromJSON(e))
|
|
164
|
+
: globalThis.Array.isArray(object?.ips_excluded)
|
|
165
|
+
? object.ips_excluded.map((e) => geodat_1.IPRule.fromJSON(e))
|
|
149
166
|
: [],
|
|
150
167
|
metadataOnly: isSet(object.metadataOnly)
|
|
151
168
|
? globalThis.Boolean(object.metadataOnly)
|
|
@@ -168,7 +185,10 @@ exports.SniffingConfig = {
|
|
|
168
185
|
obj.destinationOverride = message.destinationOverride;
|
|
169
186
|
}
|
|
170
187
|
if (message.domainsExcluded?.length) {
|
|
171
|
-
obj.domainsExcluded = message.domainsExcluded;
|
|
188
|
+
obj.domainsExcluded = message.domainsExcluded.map((e) => geodat_1.DomainRule.toJSON(e));
|
|
189
|
+
}
|
|
190
|
+
if (message.ipsExcluded?.length) {
|
|
191
|
+
obj.ipsExcluded = message.ipsExcluded.map((e) => geodat_1.IPRule.toJSON(e));
|
|
172
192
|
}
|
|
173
193
|
if (message.metadataOnly !== false) {
|
|
174
194
|
obj.metadataOnly = message.metadataOnly;
|
|
@@ -185,7 +205,8 @@ exports.SniffingConfig = {
|
|
|
185
205
|
const message = createBaseSniffingConfig();
|
|
186
206
|
message.enabled = object.enabled ?? false;
|
|
187
207
|
message.destinationOverride = object.destinationOverride?.map((e) => e) || [];
|
|
188
|
-
message.domainsExcluded = object.domainsExcluded?.map((e) => e) || [];
|
|
208
|
+
message.domainsExcluded = object.domainsExcluded?.map((e) => geodat_1.DomainRule.fromPartial(e)) || [];
|
|
209
|
+
message.ipsExcluded = object.ipsExcluded?.map((e) => geodat_1.IPRule.fromPartial(e)) || [];
|
|
189
210
|
message.metadataOnly = object.metadataOnly ?? false;
|
|
190
211
|
message.routeOnly = object.routeOnly ?? false;
|
|
191
212
|
return message;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "xray.common.geodata";
|
|
3
|
+
export interface Domain {
|
|
4
|
+
$type: "xray.common.geodata.Domain";
|
|
5
|
+
/** Domain matching type. */
|
|
6
|
+
type: Domain_Type;
|
|
7
|
+
/** Domain value. */
|
|
8
|
+
value: string;
|
|
9
|
+
/** Attributes of this domain. May be used for filtering. */
|
|
10
|
+
attribute: Domain_Attribute[];
|
|
11
|
+
}
|
|
12
|
+
/** Type of domain value. */
|
|
13
|
+
export declare enum Domain_Type {
|
|
14
|
+
/** Substr - The value is used as a sub string. */
|
|
15
|
+
Substr = 0,
|
|
16
|
+
/** Regex - The value is used as a regular expression. */
|
|
17
|
+
Regex = 1,
|
|
18
|
+
/** Domain - The value is a domain. */
|
|
19
|
+
Domain = 2,
|
|
20
|
+
/** Full - The value is a full domain. */
|
|
21
|
+
Full = 3,
|
|
22
|
+
UNRECOGNIZED = -1
|
|
23
|
+
}
|
|
24
|
+
export declare function domain_TypeFromJSON(object: any): Domain_Type;
|
|
25
|
+
export declare function domain_TypeToJSON(object: Domain_Type): string;
|
|
26
|
+
export interface Domain_Attribute {
|
|
27
|
+
$type: "xray.common.geodata.Domain.Attribute";
|
|
28
|
+
key: string;
|
|
29
|
+
boolValue?: boolean | undefined;
|
|
30
|
+
intValue?: number | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface GeoSite {
|
|
33
|
+
$type: "xray.common.geodata.GeoSite";
|
|
34
|
+
code: string;
|
|
35
|
+
domain: Domain[];
|
|
36
|
+
}
|
|
37
|
+
export interface GeoSiteList {
|
|
38
|
+
$type: "xray.common.geodata.GeoSiteList";
|
|
39
|
+
entry: GeoSite[];
|
|
40
|
+
}
|
|
41
|
+
export interface GeoSiteRule {
|
|
42
|
+
$type: "xray.common.geodata.GeoSiteRule";
|
|
43
|
+
file: string;
|
|
44
|
+
code: string;
|
|
45
|
+
attrs: string;
|
|
46
|
+
}
|
|
47
|
+
export interface DomainRule {
|
|
48
|
+
$type: "xray.common.geodata.DomainRule";
|
|
49
|
+
geosite?: GeoSiteRule | undefined;
|
|
50
|
+
custom?: Domain | undefined;
|
|
51
|
+
}
|
|
52
|
+
export interface CIDR {
|
|
53
|
+
$type: "xray.common.geodata.CIDR";
|
|
54
|
+
/** IP address, should be either 4 or 16 bytes. */
|
|
55
|
+
ip: Uint8Array;
|
|
56
|
+
/** Number of leading ones in the network mask. */
|
|
57
|
+
prefix: number;
|
|
58
|
+
}
|
|
59
|
+
export interface CIDRRule {
|
|
60
|
+
$type: "xray.common.geodata.CIDRRule";
|
|
61
|
+
cidr: CIDR | undefined;
|
|
62
|
+
reverseMatch: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface GeoIP {
|
|
65
|
+
$type: "xray.common.geodata.GeoIP";
|
|
66
|
+
code: string;
|
|
67
|
+
cidr: CIDR[];
|
|
68
|
+
reverseMatch: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface GeoIPList {
|
|
71
|
+
$type: "xray.common.geodata.GeoIPList";
|
|
72
|
+
entry: GeoIP[];
|
|
73
|
+
}
|
|
74
|
+
export interface GeoIPRule {
|
|
75
|
+
$type: "xray.common.geodata.GeoIPRule";
|
|
76
|
+
file: string;
|
|
77
|
+
code: string;
|
|
78
|
+
reverseMatch: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface IPRule {
|
|
81
|
+
$type: "xray.common.geodata.IPRule";
|
|
82
|
+
geoip?: GeoIPRule | undefined;
|
|
83
|
+
custom?: CIDRRule | undefined;
|
|
84
|
+
}
|
|
85
|
+
export declare const Domain: MessageFns<Domain, "xray.common.geodata.Domain">;
|
|
86
|
+
export declare const Domain_Attribute: MessageFns<Domain_Attribute, "xray.common.geodata.Domain.Attribute">;
|
|
87
|
+
export declare const GeoSite: MessageFns<GeoSite, "xray.common.geodata.GeoSite">;
|
|
88
|
+
export declare const GeoSiteList: MessageFns<GeoSiteList, "xray.common.geodata.GeoSiteList">;
|
|
89
|
+
export declare const GeoSiteRule: MessageFns<GeoSiteRule, "xray.common.geodata.GeoSiteRule">;
|
|
90
|
+
export declare const DomainRule: MessageFns<DomainRule, "xray.common.geodata.DomainRule">;
|
|
91
|
+
export declare const CIDR: MessageFns<CIDR, "xray.common.geodata.CIDR">;
|
|
92
|
+
export declare const CIDRRule: MessageFns<CIDRRule, "xray.common.geodata.CIDRRule">;
|
|
93
|
+
export declare const GeoIP: MessageFns<GeoIP, "xray.common.geodata.GeoIP">;
|
|
94
|
+
export declare const GeoIPList: MessageFns<GeoIPList, "xray.common.geodata.GeoIPList">;
|
|
95
|
+
export declare const GeoIPRule: MessageFns<GeoIPRule, "xray.common.geodata.GeoIPRule">;
|
|
96
|
+
export declare const IPRule: MessageFns<IPRule, "xray.common.geodata.IPRule">;
|
|
97
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
98
|
+
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 {} ? {
|
|
99
|
+
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
100
|
+
} : Partial<T>;
|
|
101
|
+
export interface MessageFns<T, V extends string> {
|
|
102
|
+
readonly $type: V;
|
|
103
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
104
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
105
|
+
fromJSON(object: any): T;
|
|
106
|
+
toJSON(message: T): unknown;
|
|
107
|
+
create(base?: DeepPartial<T>): T;
|
|
108
|
+
fromPartial(object: DeepPartial<T>): T;
|
|
109
|
+
}
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=geodat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geodat.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/common/geodata/geodat.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,4BAA4B,CAAC;IACpC,4BAA4B;IAC5B,IAAI,EAAE,WAAW,C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