@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.
Files changed (44) hide show
  1. package/README.md +3 -1
  2. package/build/src/router/interfaces/index.d.ts +0 -1
  3. package/build/src/router/interfaces/index.d.ts.map +1 -1
  4. package/build/src/router/interfaces/index.js +0 -1
  5. package/build/src/router/models/index.d.ts +0 -1
  6. package/build/src/router/models/index.d.ts.map +1 -1
  7. package/build/src/router/models/index.js +0 -1
  8. package/build/src/router/router.service.d.ts +2 -12
  9. package/build/src/router/router.service.d.ts.map +1 -1
  10. package/build/src/router/router.service.js +1 -57
  11. package/build/src/xray-protos/app/geodata/config.d.ts +30 -0
  12. package/build/src/xray-protos/app/geodata/config.d.ts.map +1 -0
  13. package/build/src/xray-protos/app/geodata/config.js +172 -0
  14. package/build/src/xray-protos/app/proxyman/config.d.ts +3 -1
  15. package/build/src/xray-protos/app/proxyman/config.d.ts.map +1 -1
  16. package/build/src/xray-protos/app/proxyman/config.js +27 -6
  17. package/build/src/xray-protos/common/geodata/geodat.d.ts +111 -0
  18. package/build/src/xray-protos/common/geodata/geodat.d.ts.map +1 -0
  19. package/build/src/xray-protos/common/geodata/geodat.js +1027 -0
  20. package/build/src/xray-protos/proxy/dns/config.d.ts +19 -7
  21. package/build/src/xray-protos/proxy/dns/config.d.ts.map +1 -1
  22. package/build/src/xray-protos/proxy/dns/config.js +161 -52
  23. package/build/src/xray-protos/proxy/freedom/config.d.ts +26 -0
  24. package/build/src/xray-protos/proxy/freedom/config.d.ts.map +1 -1
  25. package/build/src/xray-protos/proxy/freedom/config.js +272 -1
  26. package/build/src/xray-protos/proxy/tun/config.d.ts +4 -0
  27. package/build/src/xray-protos/proxy/tun/config.d.ts.map +1 -1
  28. package/build/src/xray-protos/proxy/tun/config.js +80 -3
  29. package/build/src/xray-protos/transport/internet/config.d.ts +0 -2
  30. package/build/src/xray-protos/transport/internet/config.d.ts.map +1 -1
  31. package/build/src/xray-protos/transport/internet/config.js +0 -65
  32. package/package.json +3 -4
  33. package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts +0 -7
  34. package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts.map +0 -1
  35. package/build/src/router/interfaces/add-source-ip-rule.interface.js +0 -2
  36. package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts +0 -5
  37. package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts.map +0 -1
  38. package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.js +0 -9
  39. package/build/src/router/models/add-source-ip-rule/index.d.ts +0 -2
  40. package/build/src/router/models/add-source-ip-rule/index.d.ts.map +0 -1
  41. package/build/src/router/models/add-source-ip-rule/index.js +0 -17
  42. package/build/src/xray-protos/app/router/config.d.ts +0 -193
  43. package/build/src/xray-protos/app/router/config.d.ts.map +0 -1
  44. package/build/src/xray-protos/app/router/config.js +0 -1797
@@ -5,13 +5,49 @@
5
5
  // protoc v6.33.4
6
6
  // source: proxy/freedom/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Config = exports.Noise = exports.Fragment = exports.DestinationOverride = exports.protobufPackage = void 0;
8
+ exports.Config = exports.FinalRuleConfig = exports.Range = exports.Noise = exports.Fragment = exports.DestinationOverride = exports.RuleAction = exports.protobufPackage = void 0;
9
+ exports.ruleActionFromJSON = ruleActionFromJSON;
10
+ exports.ruleActionToJSON = ruleActionToJSON;
9
11
  /* eslint-disable */
10
12
  const wire_1 = require("@bufbuild/protobuf/wire");
13
+ const geodat_1 = require("../../common/geodata/geodat");
14
+ const network_1 = require("../../common/net/network");
15
+ const port_1 = require("../../common/net/port");
11
16
  const server_spec_1 = require("../../common/protocol/server_spec");
12
17
  const config_1 = require("../../transport/internet/config");
13
18
  const typeRegistry_1 = require("../../typeRegistry");
14
19
  exports.protobufPackage = "xray.proxy.freedom";
20
+ var RuleAction;
21
+ (function (RuleAction) {
22
+ RuleAction[RuleAction["Allow"] = 0] = "Allow";
23
+ RuleAction[RuleAction["Block"] = 1] = "Block";
24
+ RuleAction[RuleAction["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
25
+ })(RuleAction || (exports.RuleAction = RuleAction = {}));
26
+ function ruleActionFromJSON(object) {
27
+ switch (object) {
28
+ case 0:
29
+ case "Allow":
30
+ return RuleAction.Allow;
31
+ case 1:
32
+ case "Block":
33
+ return RuleAction.Block;
34
+ case -1:
35
+ case "UNRECOGNIZED":
36
+ default:
37
+ return RuleAction.UNRECOGNIZED;
38
+ }
39
+ }
40
+ function ruleActionToJSON(object) {
41
+ switch (object) {
42
+ case RuleAction.Allow:
43
+ return "Allow";
44
+ case RuleAction.Block:
45
+ return "Block";
46
+ case RuleAction.UNRECOGNIZED:
47
+ default:
48
+ return "UNRECOGNIZED";
49
+ }
50
+ }
15
51
  function createBaseDestinationOverride() {
16
52
  return { $type: "xray.proxy.freedom.DestinationOverride", server: undefined };
17
53
  }
@@ -432,6 +468,221 @@ exports.Noise = {
432
468
  },
433
469
  };
434
470
  typeRegistry_1.messageTypeRegistry.set(exports.Noise.$type, exports.Noise);
471
+ function createBaseRange() {
472
+ return { $type: "xray.proxy.freedom.Range", min: 0, max: 0 };
473
+ }
474
+ exports.Range = {
475
+ $type: "xray.proxy.freedom.Range",
476
+ encode(message, writer = new wire_1.BinaryWriter()) {
477
+ if (message.min !== 0) {
478
+ writer.uint32(8).uint64(message.min);
479
+ }
480
+ if (message.max !== 0) {
481
+ writer.uint32(16).uint64(message.max);
482
+ }
483
+ return writer;
484
+ },
485
+ decode(input, length) {
486
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
487
+ const end = length === undefined ? reader.len : reader.pos + length;
488
+ const message = createBaseRange();
489
+ while (reader.pos < end) {
490
+ const tag = reader.uint32();
491
+ switch (tag >>> 3) {
492
+ case 1: {
493
+ if (tag !== 8) {
494
+ break;
495
+ }
496
+ message.min = longToNumber(reader.uint64());
497
+ continue;
498
+ }
499
+ case 2: {
500
+ if (tag !== 16) {
501
+ break;
502
+ }
503
+ message.max = longToNumber(reader.uint64());
504
+ continue;
505
+ }
506
+ }
507
+ if ((tag & 7) === 4 || tag === 0) {
508
+ break;
509
+ }
510
+ reader.skip(tag & 7);
511
+ }
512
+ return message;
513
+ },
514
+ fromJSON(object) {
515
+ return {
516
+ $type: exports.Range.$type,
517
+ min: isSet(object.min) ? globalThis.Number(object.min) : 0,
518
+ max: isSet(object.max) ? globalThis.Number(object.max) : 0,
519
+ };
520
+ },
521
+ toJSON(message) {
522
+ const obj = {};
523
+ if (message.min !== 0) {
524
+ obj.min = Math.round(message.min);
525
+ }
526
+ if (message.max !== 0) {
527
+ obj.max = Math.round(message.max);
528
+ }
529
+ return obj;
530
+ },
531
+ create(base) {
532
+ return exports.Range.fromPartial(base ?? {});
533
+ },
534
+ fromPartial(object) {
535
+ const message = createBaseRange();
536
+ message.min = object.min ?? 0;
537
+ message.max = object.max ?? 0;
538
+ return message;
539
+ },
540
+ };
541
+ typeRegistry_1.messageTypeRegistry.set(exports.Range.$type, exports.Range);
542
+ function createBaseFinalRuleConfig() {
543
+ return {
544
+ $type: "xray.proxy.freedom.FinalRuleConfig",
545
+ action: 0,
546
+ networks: [],
547
+ portList: undefined,
548
+ ip: [],
549
+ blockDelay: undefined,
550
+ };
551
+ }
552
+ exports.FinalRuleConfig = {
553
+ $type: "xray.proxy.freedom.FinalRuleConfig",
554
+ encode(message, writer = new wire_1.BinaryWriter()) {
555
+ if (message.action !== 0) {
556
+ writer.uint32(8).int32(message.action);
557
+ }
558
+ writer.uint32(18).fork();
559
+ for (const v of message.networks) {
560
+ writer.int32(v);
561
+ }
562
+ writer.join();
563
+ if (message.portList !== undefined) {
564
+ port_1.PortList.encode(message.portList, writer.uint32(26).fork()).join();
565
+ }
566
+ for (const v of message.ip) {
567
+ geodat_1.IPRule.encode(v, writer.uint32(34).fork()).join();
568
+ }
569
+ if (message.blockDelay !== undefined) {
570
+ exports.Range.encode(message.blockDelay, writer.uint32(42).fork()).join();
571
+ }
572
+ return writer;
573
+ },
574
+ decode(input, length) {
575
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
576
+ const end = length === undefined ? reader.len : reader.pos + length;
577
+ const message = createBaseFinalRuleConfig();
578
+ while (reader.pos < end) {
579
+ const tag = reader.uint32();
580
+ switch (tag >>> 3) {
581
+ case 1: {
582
+ if (tag !== 8) {
583
+ break;
584
+ }
585
+ message.action = reader.int32();
586
+ continue;
587
+ }
588
+ case 2: {
589
+ if (tag === 16) {
590
+ message.networks.push(reader.int32());
591
+ continue;
592
+ }
593
+ if (tag === 18) {
594
+ const end2 = reader.uint32() + reader.pos;
595
+ while (reader.pos < end2) {
596
+ message.networks.push(reader.int32());
597
+ }
598
+ continue;
599
+ }
600
+ break;
601
+ }
602
+ case 3: {
603
+ if (tag !== 26) {
604
+ break;
605
+ }
606
+ message.portList = port_1.PortList.decode(reader, reader.uint32());
607
+ continue;
608
+ }
609
+ case 4: {
610
+ if (tag !== 34) {
611
+ break;
612
+ }
613
+ message.ip.push(geodat_1.IPRule.decode(reader, reader.uint32()));
614
+ continue;
615
+ }
616
+ case 5: {
617
+ if (tag !== 42) {
618
+ break;
619
+ }
620
+ message.blockDelay = exports.Range.decode(reader, reader.uint32());
621
+ continue;
622
+ }
623
+ }
624
+ if ((tag & 7) === 4 || tag === 0) {
625
+ break;
626
+ }
627
+ reader.skip(tag & 7);
628
+ }
629
+ return message;
630
+ },
631
+ fromJSON(object) {
632
+ return {
633
+ $type: exports.FinalRuleConfig.$type,
634
+ action: isSet(object.action) ? ruleActionFromJSON(object.action) : 0,
635
+ networks: globalThis.Array.isArray(object?.networks) ? object.networks.map((e) => (0, network_1.networkFromJSON)(e)) : [],
636
+ portList: isSet(object.portList)
637
+ ? port_1.PortList.fromJSON(object.portList)
638
+ : isSet(object.port_list)
639
+ ? port_1.PortList.fromJSON(object.port_list)
640
+ : undefined,
641
+ ip: globalThis.Array.isArray(object?.ip) ? object.ip.map((e) => geodat_1.IPRule.fromJSON(e)) : [],
642
+ blockDelay: isSet(object.blockDelay)
643
+ ? exports.Range.fromJSON(object.blockDelay)
644
+ : isSet(object.block_delay)
645
+ ? exports.Range.fromJSON(object.block_delay)
646
+ : undefined,
647
+ };
648
+ },
649
+ toJSON(message) {
650
+ const obj = {};
651
+ if (message.action !== 0) {
652
+ obj.action = ruleActionToJSON(message.action);
653
+ }
654
+ if (message.networks?.length) {
655
+ obj.networks = message.networks.map((e) => (0, network_1.networkToJSON)(e));
656
+ }
657
+ if (message.portList !== undefined) {
658
+ obj.portList = port_1.PortList.toJSON(message.portList);
659
+ }
660
+ if (message.ip?.length) {
661
+ obj.ip = message.ip.map((e) => geodat_1.IPRule.toJSON(e));
662
+ }
663
+ if (message.blockDelay !== undefined) {
664
+ obj.blockDelay = exports.Range.toJSON(message.blockDelay);
665
+ }
666
+ return obj;
667
+ },
668
+ create(base) {
669
+ return exports.FinalRuleConfig.fromPartial(base ?? {});
670
+ },
671
+ fromPartial(object) {
672
+ const message = createBaseFinalRuleConfig();
673
+ message.action = object.action ?? 0;
674
+ message.networks = object.networks?.map((e) => e) || [];
675
+ message.portList = (object.portList !== undefined && object.portList !== null)
676
+ ? port_1.PortList.fromPartial(object.portList)
677
+ : undefined;
678
+ message.ip = object.ip?.map((e) => geodat_1.IPRule.fromPartial(e)) || [];
679
+ message.blockDelay = (object.blockDelay !== undefined && object.blockDelay !== null)
680
+ ? exports.Range.fromPartial(object.blockDelay)
681
+ : undefined;
682
+ return message;
683
+ },
684
+ };
685
+ typeRegistry_1.messageTypeRegistry.set(exports.FinalRuleConfig.$type, exports.FinalRuleConfig);
435
686
  function createBaseConfig() {
436
687
  return {
437
688
  $type: "xray.proxy.freedom.Config",
@@ -441,6 +692,7 @@ function createBaseConfig() {
441
692
  fragment: undefined,
442
693
  proxyProtocol: 0,
443
694
  noises: [],
695
+ finalRules: [],
444
696
  };
445
697
  }
446
698
  exports.Config = {
@@ -464,6 +716,9 @@ exports.Config = {
464
716
  for (const v of message.noises) {
465
717
  exports.Noise.encode(v, writer.uint32(58).fork()).join();
466
718
  }
719
+ for (const v of message.finalRules) {
720
+ exports.FinalRuleConfig.encode(v, writer.uint32(66).fork()).join();
721
+ }
467
722
  return writer;
468
723
  },
469
724
  decode(input, length) {
@@ -515,6 +770,13 @@ exports.Config = {
515
770
  message.noises.push(exports.Noise.decode(reader, reader.uint32()));
516
771
  continue;
517
772
  }
773
+ case 8: {
774
+ if (tag !== 66) {
775
+ break;
776
+ }
777
+ message.finalRules.push(exports.FinalRuleConfig.decode(reader, reader.uint32()));
778
+ continue;
779
+ }
518
780
  }
519
781
  if ((tag & 7) === 4 || tag === 0) {
520
782
  break;
@@ -548,6 +810,11 @@ exports.Config = {
548
810
  ? globalThis.Number(object.proxy_protocol)
549
811
  : 0,
550
812
  noises: globalThis.Array.isArray(object?.noises) ? object.noises.map((e) => exports.Noise.fromJSON(e)) : [],
813
+ finalRules: globalThis.Array.isArray(object?.finalRules)
814
+ ? object.finalRules.map((e) => exports.FinalRuleConfig.fromJSON(e))
815
+ : globalThis.Array.isArray(object?.final_rules)
816
+ ? object.final_rules.map((e) => exports.FinalRuleConfig.fromJSON(e))
817
+ : [],
551
818
  };
552
819
  },
553
820
  toJSON(message) {
@@ -570,6 +837,9 @@ exports.Config = {
570
837
  if (message.noises?.length) {
571
838
  obj.noises = message.noises.map((e) => exports.Noise.toJSON(e));
572
839
  }
840
+ if (message.finalRules?.length) {
841
+ obj.finalRules = message.finalRules.map((e) => exports.FinalRuleConfig.toJSON(e));
842
+ }
573
843
  return obj;
574
844
  },
575
845
  create(base) {
@@ -587,6 +857,7 @@ exports.Config = {
587
857
  : undefined;
588
858
  message.proxyProtocol = object.proxyProtocol ?? 0;
589
859
  message.noises = object.noises?.map((e) => exports.Noise.fromPartial(e)) || [];
860
+ message.finalRules = object.finalRules?.map((e) => exports.FinalRuleConfig.fromPartial(e)) || [];
590
861
  return message;
591
862
  },
592
863
  };
@@ -4,7 +4,11 @@ export interface Config {
4
4
  $type: "xray.proxy.tun.Config";
5
5
  name: string;
6
6
  MTU: number;
7
+ gateway: string[];
8
+ DNS: string[];
7
9
  userLevel: number;
10
+ autoSystemRoutingTable: string[];
11
+ autoOutboundsInterface: string;
8
12
  }
9
13
  export declare const Config: MessageFns<Config, "xray.proxy.tun.Config">;
10
14
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/tun/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAEhD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,uBAAuB,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,uBAAuB,CA6F9D,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,E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.tun";
13
13
  function createBaseConfig() {
14
- return { $type: "xray.proxy.tun.Config", name: "", MTU: 0, userLevel: 0 };
14
+ return {
15
+ $type: "xray.proxy.tun.Config",
16
+ name: "",
17
+ MTU: 0,
18
+ gateway: [],
19
+ DNS: [],
20
+ userLevel: 0,
21
+ autoSystemRoutingTable: [],
22
+ autoOutboundsInterface: "",
23
+ };
15
24
  }
16
25
  exports.Config = {
17
26
  $type: "xray.proxy.tun.Config",
@@ -22,8 +31,20 @@ exports.Config = {
22
31
  if (message.MTU !== 0) {
23
32
  writer.uint32(16).uint32(message.MTU);
24
33
  }
34
+ for (const v of message.gateway) {
35
+ writer.uint32(26).string(v);
36
+ }
37
+ for (const v of message.DNS) {
38
+ writer.uint32(34).string(v);
39
+ }
25
40
  if (message.userLevel !== 0) {
26
- writer.uint32(24).uint32(message.userLevel);
41
+ writer.uint32(40).uint32(message.userLevel);
42
+ }
43
+ for (const v of message.autoSystemRoutingTable) {
44
+ writer.uint32(50).string(v);
45
+ }
46
+ if (message.autoOutboundsInterface !== "") {
47
+ writer.uint32(58).string(message.autoOutboundsInterface);
27
48
  }
28
49
  return writer;
29
50
  },
@@ -49,12 +70,40 @@ exports.Config = {
49
70
  continue;
50
71
  }
51
72
  case 3: {
52
- if (tag !== 24) {
73
+ if (tag !== 26) {
74
+ break;
75
+ }
76
+ message.gateway.push(reader.string());
77
+ continue;
78
+ }
79
+ case 4: {
80
+ if (tag !== 34) {
81
+ break;
82
+ }
83
+ message.DNS.push(reader.string());
84
+ continue;
85
+ }
86
+ case 5: {
87
+ if (tag !== 40) {
53
88
  break;
54
89
  }
55
90
  message.userLevel = reader.uint32();
56
91
  continue;
57
92
  }
93
+ case 6: {
94
+ if (tag !== 50) {
95
+ break;
96
+ }
97
+ message.autoSystemRoutingTable.push(reader.string());
98
+ continue;
99
+ }
100
+ case 7: {
101
+ if (tag !== 58) {
102
+ break;
103
+ }
104
+ message.autoOutboundsInterface = reader.string();
105
+ continue;
106
+ }
58
107
  }
59
108
  if ((tag & 7) === 4 || tag === 0) {
60
109
  break;
@@ -68,11 +117,23 @@ exports.Config = {
68
117
  $type: exports.Config.$type,
69
118
  name: isSet(object.name) ? globalThis.String(object.name) : "",
70
119
  MTU: isSet(object.MTU) ? globalThis.Number(object.MTU) : 0,
120
+ gateway: globalThis.Array.isArray(object?.gateway) ? object.gateway.map((e) => globalThis.String(e)) : [],
121
+ DNS: globalThis.Array.isArray(object?.DNS) ? object.DNS.map((e) => globalThis.String(e)) : [],
71
122
  userLevel: isSet(object.userLevel)
72
123
  ? globalThis.Number(object.userLevel)
73
124
  : isSet(object.user_level)
74
125
  ? globalThis.Number(object.user_level)
75
126
  : 0,
127
+ autoSystemRoutingTable: globalThis.Array.isArray(object?.autoSystemRoutingTable)
128
+ ? object.autoSystemRoutingTable.map((e) => globalThis.String(e))
129
+ : globalThis.Array.isArray(object?.auto_system_routing_table)
130
+ ? object.auto_system_routing_table.map((e) => globalThis.String(e))
131
+ : [],
132
+ autoOutboundsInterface: isSet(object.autoOutboundsInterface)
133
+ ? globalThis.String(object.autoOutboundsInterface)
134
+ : isSet(object.auto_outbounds_interface)
135
+ ? globalThis.String(object.auto_outbounds_interface)
136
+ : "",
76
137
  };
77
138
  },
78
139
  toJSON(message) {
@@ -83,9 +144,21 @@ exports.Config = {
83
144
  if (message.MTU !== 0) {
84
145
  obj.MTU = Math.round(message.MTU);
85
146
  }
147
+ if (message.gateway?.length) {
148
+ obj.gateway = message.gateway;
149
+ }
150
+ if (message.DNS?.length) {
151
+ obj.DNS = message.DNS;
152
+ }
86
153
  if (message.userLevel !== 0) {
87
154
  obj.userLevel = Math.round(message.userLevel);
88
155
  }
156
+ if (message.autoSystemRoutingTable?.length) {
157
+ obj.autoSystemRoutingTable = message.autoSystemRoutingTable;
158
+ }
159
+ if (message.autoOutboundsInterface !== "") {
160
+ obj.autoOutboundsInterface = message.autoOutboundsInterface;
161
+ }
89
162
  return obj;
90
163
  },
91
164
  create(base) {
@@ -95,7 +168,11 @@ exports.Config = {
95
168
  const message = createBaseConfig();
96
169
  message.name = object.name ?? "";
97
170
  message.MTU = object.MTU ?? 0;
171
+ message.gateway = object.gateway?.map((e) => e) || [];
172
+ message.DNS = object.DNS?.map((e) => e) || [];
98
173
  message.userLevel = object.userLevel ?? 0;
174
+ message.autoSystemRoutingTable = object.autoSystemRoutingTable?.map((e) => e) || [];
175
+ message.autoOutboundsInterface = object.autoOutboundsInterface ?? "";
99
176
  return message;
100
177
  },
101
178
  };
@@ -103,8 +103,6 @@ export interface SocketConfig {
103
103
  * option. This option is for UDP only.
104
104
  */
105
105
  receiveOriginalDestAddress: boolean;
106
- bindAddress: Uint8Array;
107
- bindPort: number;
108
106
  acceptProxyProtocol: boolean;
109
107
  domainStrategy: DomainStrategy;
110
108
  dialerProxy: string;
@@ -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,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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G,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
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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AC,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"}
@@ -1139,8 +1139,6 @@ function createBaseSocketConfig() {
1139
1139
  tfo: 0,
1140
1140
  tproxy: 0,
1141
1141
  receiveOriginalDestAddress: false,
1142
- bindAddress: new Uint8Array(0),
1143
- bindPort: 0,
1144
1142
  acceptProxyProtocol: false,
1145
1143
  domainStrategy: 0,
1146
1144
  dialerProxy: "",
@@ -1175,12 +1173,6 @@ exports.SocketConfig = {
1175
1173
  if (message.receiveOriginalDestAddress !== false) {
1176
1174
  writer.uint32(32).bool(message.receiveOriginalDestAddress);
1177
1175
  }
1178
- if (message.bindAddress.length !== 0) {
1179
- writer.uint32(42).bytes(message.bindAddress);
1180
- }
1181
- if (message.bindPort !== 0) {
1182
- writer.uint32(48).uint32(message.bindPort);
1183
- }
1184
1176
  if (message.acceptProxyProtocol !== false) {
1185
1177
  writer.uint32(56).bool(message.acceptProxyProtocol);
1186
1178
  }
@@ -1269,20 +1261,6 @@ exports.SocketConfig = {
1269
1261
  message.receiveOriginalDestAddress = reader.bool();
1270
1262
  continue;
1271
1263
  }
1272
- case 5: {
1273
- if (tag !== 42) {
1274
- break;
1275
- }
1276
- message.bindAddress = reader.bytes();
1277
- continue;
1278
- }
1279
- case 6: {
1280
- if (tag !== 48) {
1281
- break;
1282
- }
1283
- message.bindPort = reader.uint32();
1284
- continue;
1285
- }
1286
1264
  case 7: {
1287
1265
  if (tag !== 56) {
1288
1266
  break;
@@ -1421,16 +1399,6 @@ exports.SocketConfig = {
1421
1399
  : isSet(object.receive_original_dest_address)
1422
1400
  ? globalThis.Boolean(object.receive_original_dest_address)
1423
1401
  : false,
1424
- bindAddress: isSet(object.bindAddress)
1425
- ? bytesFromBase64(object.bindAddress)
1426
- : isSet(object.bind_address)
1427
- ? bytesFromBase64(object.bind_address)
1428
- : new Uint8Array(0),
1429
- bindPort: isSet(object.bindPort)
1430
- ? globalThis.Number(object.bindPort)
1431
- : isSet(object.bind_port)
1432
- ? globalThis.Number(object.bind_port)
1433
- : 0,
1434
1402
  acceptProxyProtocol: isSet(object.acceptProxyProtocol)
1435
1403
  ? globalThis.Boolean(object.acceptProxyProtocol)
1436
1404
  : isSet(object.accept_proxy_protocol)
@@ -1518,12 +1486,6 @@ exports.SocketConfig = {
1518
1486
  if (message.receiveOriginalDestAddress !== false) {
1519
1487
  obj.receiveOriginalDestAddress = message.receiveOriginalDestAddress;
1520
1488
  }
1521
- if (message.bindAddress.length !== 0) {
1522
- obj.bindAddress = base64FromBytes(message.bindAddress);
1523
- }
1524
- if (message.bindPort !== 0) {
1525
- obj.bindPort = Math.round(message.bindPort);
1526
- }
1527
1489
  if (message.acceptProxyProtocol !== false) {
1528
1490
  obj.acceptProxyProtocol = message.acceptProxyProtocol;
1529
1491
  }
@@ -1586,8 +1548,6 @@ exports.SocketConfig = {
1586
1548
  message.tfo = object.tfo ?? 0;
1587
1549
  message.tproxy = object.tproxy ?? 0;
1588
1550
  message.receiveOriginalDestAddress = object.receiveOriginalDestAddress ?? false;
1589
- message.bindAddress = object.bindAddress ?? new Uint8Array(0);
1590
- message.bindPort = object.bindPort ?? 0;
1591
1551
  message.acceptProxyProtocol = object.acceptProxyProtocol ?? false;
1592
1552
  message.domainStrategy = object.domainStrategy ?? 0;
1593
1553
  message.dialerProxy = object.dialerProxy ?? "";
@@ -1730,31 +1690,6 @@ exports.HappyEyeballsConfig = {
1730
1690
  },
1731
1691
  };
1732
1692
  typeRegistry_1.messageTypeRegistry.set(exports.HappyEyeballsConfig.$type, exports.HappyEyeballsConfig);
1733
- function bytesFromBase64(b64) {
1734
- if (globalThis.Buffer) {
1735
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
1736
- }
1737
- else {
1738
- const bin = globalThis.atob(b64);
1739
- const arr = new Uint8Array(bin.length);
1740
- for (let i = 0; i < bin.length; ++i) {
1741
- arr[i] = bin.charCodeAt(i);
1742
- }
1743
- return arr;
1744
- }
1745
- }
1746
- function base64FromBytes(arr) {
1747
- if (globalThis.Buffer) {
1748
- return globalThis.Buffer.from(arr).toString("base64");
1749
- }
1750
- else {
1751
- const bin = [];
1752
- arr.forEach((byte) => {
1753
- bin.push(globalThis.String.fromCharCode(byte));
1754
- });
1755
- return globalThis.btoa(bin.join(""));
1756
- }
1757
- }
1758
1693
  function longToNumber(int64) {
1759
1694
  const num = globalThis.Number(int64.toString());
1760
1695
  if (num > globalThis.Number.MAX_SAFE_INTEGER) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnawave/xtls-sdk",
3
- "version": "0.12.5",
3
+ "version": "0.14.0",
4
4
  "description": "A Typescript SDK for XRAY (XTLS) Core GRPC Api",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -38,10 +38,9 @@
38
38
  "vless"
39
39
  ],
40
40
  "dependencies": {
41
- "ipaddr.js": "2.3.0",
42
41
  "long": "^5.3.2",
43
- "nice-grpc": "^2.1.14",
44
- "protobufjs": "^8.0.0",
42
+ "nice-grpc": "^2.1.15",
43
+ "protobufjs": "^8.0.1",
45
44
  "@bufbuild/protobuf": "^2.11.0"
46
45
  },
47
46
  "devDependencies": {
@@ -1,7 +0,0 @@
1
- export interface IAddSourceIpRule {
2
- ruleTag: string;
3
- ip: string;
4
- outbound: string;
5
- append: boolean;
6
- }
7
- //# sourceMappingURL=add-source-ip-rule.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-source-ip-rule.interface.d.ts","sourceRoot":"","sources":["../../../../src/router/interfaces/add-source-ip-rule.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACnB"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });