@remnawave/xtls-sdk 0.0.4 → 0.0.6

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 (85) hide show
  1. package/package.json +1 -1
  2. package/build/scripts/export-protos.d.ts +0 -2
  3. package/build/scripts/export-protos.d.ts.map +0 -1
  4. package/build/scripts/export-protos.js +0 -122
  5. package/build/src/xray-protos/app/dns/config.d.ts +0 -93
  6. package/build/src/xray-protos/app/dns/config.d.ts.map +0 -1
  7. package/build/src/xray-protos/app/dns/config.js +0 -707
  8. package/build/src/xray-protos/app/dns/fakedns/fakedns.d.ts +0 -30
  9. package/build/src/xray-protos/app/dns/fakedns/fakedns.d.ts.map +0 -1
  10. package/build/src/xray-protos/app/dns/fakedns/fakedns.js +0 -152
  11. package/build/src/xray-protos/app/observatory/burst/config.d.ts +0 -41
  12. package/build/src/xray-protos/app/observatory/burst/config.d.ts.map +0 -1
  13. package/build/src/xray-protos/app/observatory/burst/config.js +0 -223
  14. package/build/src/xray-protos/app/observatory/command/command.d.ts +0 -53
  15. package/build/src/xray-protos/app/observatory/command/command.d.ts.map +0 -1
  16. package/build/src/xray-protos/app/observatory/command/command.js +0 -166
  17. package/build/src/xray-protos/app/observatory/config.d.ts +0 -106
  18. package/build/src/xray-protos/app/observatory/config.d.ts.map +0 -1
  19. package/build/src/xray-protos/app/observatory/config.js +0 -628
  20. package/build/src/xray-protos/app/router/command/command.d.ts +0 -222
  21. package/build/src/xray-protos/app/router/command/command.d.ts.map +0 -1
  22. package/build/src/xray-protos/app/router/command/command.js +0 -1235
  23. package/build/src/xray-protos/app/router/config.d.ts +0 -176
  24. package/build/src/xray-protos/app/router/config.d.ts.map +0 -1
  25. package/build/src/xray-protos/app/router/config.js +0 -1484
  26. package/build/src/xray-protos/transport/internet/grpc/config.d.ts +0 -29
  27. package/build/src/xray-protos/transport/internet/grpc/config.d.ts.map +0 -1
  28. package/build/src/xray-protos/transport/internet/grpc/config.js +0 -186
  29. package/build/src/xray-protos/transport/internet/grpc/encoding/stream.d.ts +0 -62
  30. package/build/src/xray-protos/transport/internet/grpc/encoding/stream.d.ts.map +0 -1
  31. package/build/src/xray-protos/transport/internet/grpc/encoding/stream.js +0 -164
  32. package/build/src/xray-protos/transport/internet/headers/dns/config.d.ts +0 -22
  33. package/build/src/xray-protos/transport/internet/headers/dns/config.d.ts.map +0 -1
  34. package/build/src/xray-protos/transport/internet/headers/dns/config.js +0 -68
  35. package/build/src/xray-protos/transport/internet/headers/http/config.d.ts +0 -80
  36. package/build/src/xray-protos/transport/internet/headers/http/config.d.ts.map +0 -1
  37. package/build/src/xray-protos/transport/internet/headers/http/config.js +0 -544
  38. package/build/src/xray-protos/transport/internet/headers/noop/config.d.ts +0 -25
  39. package/build/src/xray-protos/transport/internet/headers/noop/config.d.ts.map +0 -1
  40. package/build/src/xray-protos/transport/internet/headers/noop/config.js +0 -90
  41. package/build/src/xray-protos/transport/internet/headers/srtp/config.d.ts +0 -27
  42. package/build/src/xray-protos/transport/internet/headers/srtp/config.d.ts.map +0 -1
  43. package/build/src/xray-protos/transport/internet/headers/srtp/config.js +0 -154
  44. package/build/src/xray-protos/transport/internet/headers/tls/config.d.ts +0 -21
  45. package/build/src/xray-protos/transport/internet/headers/tls/config.d.ts.map +0 -1
  46. package/build/src/xray-protos/transport/internet/headers/tls/config.js +0 -51
  47. package/build/src/xray-protos/transport/internet/headers/utp/config.d.ts +0 -22
  48. package/build/src/xray-protos/transport/internet/headers/utp/config.d.ts.map +0 -1
  49. package/build/src/xray-protos/transport/internet/headers/utp/config.js +0 -68
  50. package/build/src/xray-protos/transport/internet/headers/wechat/config.d.ts +0 -21
  51. package/build/src/xray-protos/transport/internet/headers/wechat/config.d.ts.map +0 -1
  52. package/build/src/xray-protos/transport/internet/headers/wechat/config.js +0 -51
  53. package/build/src/xray-protos/transport/internet/headers/wireguard/config.d.ts +0 -21
  54. package/build/src/xray-protos/transport/internet/headers/wireguard/config.d.ts.map +0 -1
  55. package/build/src/xray-protos/transport/internet/headers/wireguard/config.js +0 -51
  56. package/build/src/xray-protos/transport/internet/http/config.d.ts +0 -28
  57. package/build/src/xray-protos/transport/internet/http/config.d.ts.map +0 -1
  58. package/build/src/xray-protos/transport/internet/http/config.js +0 -155
  59. package/build/src/xray-protos/transport/internet/httpupgrade/config.d.ts +0 -34
  60. package/build/src/xray-protos/transport/internet/httpupgrade/config.d.ts.map +0 -1
  61. package/build/src/xray-protos/transport/internet/httpupgrade/config.js +0 -235
  62. package/build/src/xray-protos/transport/internet/kcp/config.d.ts +0 -82
  63. package/build/src/xray-protos/transport/internet/kcp/config.d.ts.map +0 -1
  64. package/build/src/xray-protos/transport/internet/kcp/config.js +0 -639
  65. package/build/src/xray-protos/transport/internet/reality/config.d.ts +0 -38
  66. package/build/src/xray-protos/transport/internet/reality/config.d.ts.map +0 -1
  67. package/build/src/xray-protos/transport/internet/reality/config.js +0 -376
  68. package/build/src/xray-protos/transport/internet/splithttp/config.d.ts +0 -55
  69. package/build/src/xray-protos/transport/internet/splithttp/config.d.ts.map +0 -1
  70. package/build/src/xray-protos/transport/internet/splithttp/config.js +0 -536
  71. package/build/src/xray-protos/transport/internet/tcp/config.d.ts +0 -24
  72. package/build/src/xray-protos/transport/internet/tcp/config.d.ts.map +0 -1
  73. package/build/src/xray-protos/transport/internet/tcp/config.js +0 -89
  74. package/build/src/xray-protos/transport/internet/tls/config.d.ts +0 -87
  75. package/build/src/xray-protos/transport/internet/tls/config.d.ts.map +0 -1
  76. package/build/src/xray-protos/transport/internet/tls/config.js +0 -555
  77. package/build/src/xray-protos/transport/internet/udp/config.d.ts +0 -21
  78. package/build/src/xray-protos/transport/internet/udp/config.d.ts.map +0 -1
  79. package/build/src/xray-protos/transport/internet/udp/config.js +0 -51
  80. package/build/src/xray-protos/transport/internet/websocket/config.d.ts +0 -35
  81. package/build/src/xray-protos/transport/internet/websocket/config.d.ts.map +0 -1
  82. package/build/src/xray-protos/transport/internet/websocket/config.js +0 -235
  83. package/build/tests/stats.spec.d.ts +0 -2
  84. package/build/tests/stats.spec.d.ts.map +0 -1
  85. package/build/tests/stats.spec.js +0 -86
@@ -1,155 +0,0 @@
1
- "use strict";
2
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
- // versions:
4
- // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
6
- // source: transport/internet/http/config.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Config = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const typeRegistry_1 = require("../../../typeRegistry");
12
- const config_1 = require("../headers/http/config");
13
- exports.protobufPackage = "xray.transport.internet.http";
14
- function createBaseConfig() {
15
- return {
16
- $type: "xray.transport.internet.http.Config",
17
- host: [],
18
- path: "",
19
- idleTimeout: 0,
20
- healthCheckTimeout: 0,
21
- method: "",
22
- header: [],
23
- };
24
- }
25
- exports.Config = {
26
- $type: "xray.transport.internet.http.Config",
27
- encode(message, writer = new wire_1.BinaryWriter()) {
28
- for (const v of message.host) {
29
- writer.uint32(10).string(v);
30
- }
31
- if (message.path !== "") {
32
- writer.uint32(18).string(message.path);
33
- }
34
- if (message.idleTimeout !== 0) {
35
- writer.uint32(24).int32(message.idleTimeout);
36
- }
37
- if (message.healthCheckTimeout !== 0) {
38
- writer.uint32(32).int32(message.healthCheckTimeout);
39
- }
40
- if (message.method !== "") {
41
- writer.uint32(42).string(message.method);
42
- }
43
- for (const v of message.header) {
44
- config_1.Header.encode(v, writer.uint32(50).fork()).join();
45
- }
46
- return writer;
47
- },
48
- decode(input, length) {
49
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
50
- let end = length === undefined ? reader.len : reader.pos + length;
51
- const message = createBaseConfig();
52
- while (reader.pos < end) {
53
- const tag = reader.uint32();
54
- switch (tag >>> 3) {
55
- case 1: {
56
- if (tag !== 10) {
57
- break;
58
- }
59
- message.host.push(reader.string());
60
- continue;
61
- }
62
- case 2: {
63
- if (tag !== 18) {
64
- break;
65
- }
66
- message.path = reader.string();
67
- continue;
68
- }
69
- case 3: {
70
- if (tag !== 24) {
71
- break;
72
- }
73
- message.idleTimeout = reader.int32();
74
- continue;
75
- }
76
- case 4: {
77
- if (tag !== 32) {
78
- break;
79
- }
80
- message.healthCheckTimeout = reader.int32();
81
- continue;
82
- }
83
- case 5: {
84
- if (tag !== 42) {
85
- break;
86
- }
87
- message.method = reader.string();
88
- continue;
89
- }
90
- case 6: {
91
- if (tag !== 50) {
92
- break;
93
- }
94
- message.header.push(config_1.Header.decode(reader, reader.uint32()));
95
- continue;
96
- }
97
- }
98
- if ((tag & 7) === 4 || tag === 0) {
99
- break;
100
- }
101
- reader.skip(tag & 7);
102
- }
103
- return message;
104
- },
105
- fromJSON(object) {
106
- return {
107
- $type: exports.Config.$type,
108
- host: globalThis.Array.isArray(object?.host) ? object.host.map((e) => globalThis.String(e)) : [],
109
- path: isSet(object.path) ? globalThis.String(object.path) : "",
110
- idleTimeout: isSet(object.idleTimeout) ? globalThis.Number(object.idleTimeout) : 0,
111
- healthCheckTimeout: isSet(object.healthCheckTimeout) ? globalThis.Number(object.healthCheckTimeout) : 0,
112
- method: isSet(object.method) ? globalThis.String(object.method) : "",
113
- header: globalThis.Array.isArray(object?.header) ? object.header.map((e) => config_1.Header.fromJSON(e)) : [],
114
- };
115
- },
116
- toJSON(message) {
117
- const obj = {};
118
- if (message.host?.length) {
119
- obj.host = message.host;
120
- }
121
- if (message.path !== "") {
122
- obj.path = message.path;
123
- }
124
- if (message.idleTimeout !== 0) {
125
- obj.idleTimeout = Math.round(message.idleTimeout);
126
- }
127
- if (message.healthCheckTimeout !== 0) {
128
- obj.healthCheckTimeout = Math.round(message.healthCheckTimeout);
129
- }
130
- if (message.method !== "") {
131
- obj.method = message.method;
132
- }
133
- if (message.header?.length) {
134
- obj.header = message.header.map((e) => config_1.Header.toJSON(e));
135
- }
136
- return obj;
137
- },
138
- create(base) {
139
- return exports.Config.fromPartial(base ?? {});
140
- },
141
- fromPartial(object) {
142
- const message = createBaseConfig();
143
- message.host = object.host?.map((e) => e) || [];
144
- message.path = object.path ?? "";
145
- message.idleTimeout = object.idleTimeout ?? 0;
146
- message.healthCheckTimeout = object.healthCheckTimeout ?? 0;
147
- message.method = object.method ?? "";
148
- message.header = object.header?.map((e) => config_1.Header.fromPartial(e)) || [];
149
- return message;
150
- },
151
- };
152
- typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
153
- function isSet(value) {
154
- return value !== null && value !== undefined;
155
- }
@@ -1,34 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- export declare const protobufPackage = "xray.transport.internet.httpupgrade";
3
- export interface Config {
4
- $type: "xray.transport.internet.httpupgrade.Config";
5
- host: string;
6
- path: string;
7
- header: {
8
- [key: string]: string;
9
- };
10
- acceptProxyProtocol: boolean;
11
- ed: number;
12
- }
13
- export interface Config_HeaderEntry {
14
- $type: "xray.transport.internet.httpupgrade.Config.HeaderEntry";
15
- key: string;
16
- value: string;
17
- }
18
- export declare const Config: MessageFns<Config, "xray.transport.internet.httpupgrade.Config">;
19
- export declare const Config_HeaderEntry: MessageFns<Config_HeaderEntry, "xray.transport.internet.httpupgrade.Config.HeaderEntry">;
20
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
21
- 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 {} ? {
22
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
23
- } : Partial<T>;
24
- export interface MessageFns<T, V extends string> {
25
- readonly $type: V;
26
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
27
- decode(input: BinaryReader | Uint8Array, length?: number): T;
28
- fromJSON(object: any): T;
29
- toJSON(message: T): unknown;
30
- create(base?: DeepPartial<T>): T;
31
- fromPartial(object: DeepPartial<T>): T;
32
- }
33
- export {};
34
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/transport/internet/httpupgrade/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,eAAe,wCAAwC,CAAC;AAErE,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,4CAA4C,CAAC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,wDAAwD,CAAC;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAaD,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,4CAA4C,CAgJnF,CAAC;AAQF,eAAO,MAAM,kBAAkB,EAAE,UAAU,CACzC,kBAAkB,EAClB,wDAAwD,CA0EzD,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;AAUf,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"}
@@ -1,235 +0,0 @@
1
- "use strict";
2
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
- // versions:
4
- // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
6
- // source: transport/internet/httpupgrade/config.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Config_HeaderEntry = exports.Config = 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.transport.internet.httpupgrade";
13
- function createBaseConfig() {
14
- return {
15
- $type: "xray.transport.internet.httpupgrade.Config",
16
- host: "",
17
- path: "",
18
- header: {},
19
- acceptProxyProtocol: false,
20
- ed: 0,
21
- };
22
- }
23
- exports.Config = {
24
- $type: "xray.transport.internet.httpupgrade.Config",
25
- encode(message, writer = new wire_1.BinaryWriter()) {
26
- if (message.host !== "") {
27
- writer.uint32(10).string(message.host);
28
- }
29
- if (message.path !== "") {
30
- writer.uint32(18).string(message.path);
31
- }
32
- Object.entries(message.header).forEach(([key, value]) => {
33
- exports.Config_HeaderEntry.encode({
34
- $type: "xray.transport.internet.httpupgrade.Config.HeaderEntry",
35
- key: key,
36
- value,
37
- }, writer.uint32(26).fork()).join();
38
- });
39
- if (message.acceptProxyProtocol !== false) {
40
- writer.uint32(32).bool(message.acceptProxyProtocol);
41
- }
42
- if (message.ed !== 0) {
43
- writer.uint32(40).uint32(message.ed);
44
- }
45
- return writer;
46
- },
47
- decode(input, length) {
48
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
49
- let end = length === undefined ? reader.len : reader.pos + length;
50
- const message = createBaseConfig();
51
- while (reader.pos < end) {
52
- const tag = reader.uint32();
53
- switch (tag >>> 3) {
54
- case 1: {
55
- if (tag !== 10) {
56
- break;
57
- }
58
- message.host = reader.string();
59
- continue;
60
- }
61
- case 2: {
62
- if (tag !== 18) {
63
- break;
64
- }
65
- message.path = reader.string();
66
- continue;
67
- }
68
- case 3: {
69
- if (tag !== 26) {
70
- break;
71
- }
72
- const entry3 = exports.Config_HeaderEntry.decode(reader, reader.uint32());
73
- if (entry3.value !== undefined) {
74
- message.header[entry3.key] = entry3.value;
75
- }
76
- continue;
77
- }
78
- case 4: {
79
- if (tag !== 32) {
80
- break;
81
- }
82
- message.acceptProxyProtocol = reader.bool();
83
- continue;
84
- }
85
- case 5: {
86
- if (tag !== 40) {
87
- break;
88
- }
89
- message.ed = reader.uint32();
90
- continue;
91
- }
92
- }
93
- if ((tag & 7) === 4 || tag === 0) {
94
- break;
95
- }
96
- reader.skip(tag & 7);
97
- }
98
- return message;
99
- },
100
- fromJSON(object) {
101
- return {
102
- $type: exports.Config.$type,
103
- host: isSet(object.host) ? globalThis.String(object.host) : "",
104
- path: isSet(object.path) ? globalThis.String(object.path) : "",
105
- header: isObject(object.header)
106
- ? Object.entries(object.header).reduce((acc, [key, value]) => {
107
- acc[key] = String(value);
108
- return acc;
109
- }, {})
110
- : {},
111
- acceptProxyProtocol: isSet(object.acceptProxyProtocol) ? globalThis.Boolean(object.acceptProxyProtocol) : false,
112
- ed: isSet(object.ed) ? globalThis.Number(object.ed) : 0,
113
- };
114
- },
115
- toJSON(message) {
116
- const obj = {};
117
- if (message.host !== "") {
118
- obj.host = message.host;
119
- }
120
- if (message.path !== "") {
121
- obj.path = message.path;
122
- }
123
- if (message.header) {
124
- const entries = Object.entries(message.header);
125
- if (entries.length > 0) {
126
- obj.header = {};
127
- entries.forEach(([k, v]) => {
128
- obj.header[k] = v;
129
- });
130
- }
131
- }
132
- if (message.acceptProxyProtocol !== false) {
133
- obj.acceptProxyProtocol = message.acceptProxyProtocol;
134
- }
135
- if (message.ed !== 0) {
136
- obj.ed = Math.round(message.ed);
137
- }
138
- return obj;
139
- },
140
- create(base) {
141
- return exports.Config.fromPartial(base ?? {});
142
- },
143
- fromPartial(object) {
144
- const message = createBaseConfig();
145
- message.host = object.host ?? "";
146
- message.path = object.path ?? "";
147
- message.header = Object.entries(object.header ?? {}).reduce((acc, [key, value]) => {
148
- if (value !== undefined) {
149
- acc[key] = globalThis.String(value);
150
- }
151
- return acc;
152
- }, {});
153
- message.acceptProxyProtocol = object.acceptProxyProtocol ?? false;
154
- message.ed = object.ed ?? 0;
155
- return message;
156
- },
157
- };
158
- typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
159
- function createBaseConfig_HeaderEntry() {
160
- return { $type: "xray.transport.internet.httpupgrade.Config.HeaderEntry", key: "", value: "" };
161
- }
162
- exports.Config_HeaderEntry = {
163
- $type: "xray.transport.internet.httpupgrade.Config.HeaderEntry",
164
- encode(message, writer = new wire_1.BinaryWriter()) {
165
- if (message.key !== "") {
166
- writer.uint32(10).string(message.key);
167
- }
168
- if (message.value !== "") {
169
- writer.uint32(18).string(message.value);
170
- }
171
- return writer;
172
- },
173
- decode(input, length) {
174
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
175
- let end = length === undefined ? reader.len : reader.pos + length;
176
- const message = createBaseConfig_HeaderEntry();
177
- while (reader.pos < end) {
178
- const tag = reader.uint32();
179
- switch (tag >>> 3) {
180
- case 1: {
181
- if (tag !== 10) {
182
- break;
183
- }
184
- message.key = reader.string();
185
- continue;
186
- }
187
- case 2: {
188
- if (tag !== 18) {
189
- break;
190
- }
191
- message.value = reader.string();
192
- continue;
193
- }
194
- }
195
- if ((tag & 7) === 4 || tag === 0) {
196
- break;
197
- }
198
- reader.skip(tag & 7);
199
- }
200
- return message;
201
- },
202
- fromJSON(object) {
203
- return {
204
- $type: exports.Config_HeaderEntry.$type,
205
- key: isSet(object.key) ? globalThis.String(object.key) : "",
206
- value: isSet(object.value) ? globalThis.String(object.value) : "",
207
- };
208
- },
209
- toJSON(message) {
210
- const obj = {};
211
- if (message.key !== "") {
212
- obj.key = message.key;
213
- }
214
- if (message.value !== "") {
215
- obj.value = message.value;
216
- }
217
- return obj;
218
- },
219
- create(base) {
220
- return exports.Config_HeaderEntry.fromPartial(base ?? {});
221
- },
222
- fromPartial(object) {
223
- const message = createBaseConfig_HeaderEntry();
224
- message.key = object.key ?? "";
225
- message.value = object.value ?? "";
226
- return message;
227
- },
228
- };
229
- typeRegistry_1.messageTypeRegistry.set(exports.Config_HeaderEntry.$type, exports.Config_HeaderEntry);
230
- function isObject(value) {
231
- return typeof value === "object" && value !== null;
232
- }
233
- function isSet(value) {
234
- return value !== null && value !== undefined;
235
- }
@@ -1,82 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- import { TypedMessage } from "../../../common/serial/typed_message";
3
- export declare const protobufPackage = "xray.transport.internet.kcp";
4
- /** Maximum Transmission Unit, in bytes. */
5
- export interface MTU {
6
- $type: "xray.transport.internet.kcp.MTU";
7
- value: number;
8
- }
9
- /** Transmission Time Interview, in milli-sec. */
10
- export interface TTI {
11
- $type: "xray.transport.internet.kcp.TTI";
12
- value: number;
13
- }
14
- /** Uplink capacity, in MB. */
15
- export interface UplinkCapacity {
16
- $type: "xray.transport.internet.kcp.UplinkCapacity";
17
- value: number;
18
- }
19
- /** Downlink capacity, in MB. */
20
- export interface DownlinkCapacity {
21
- $type: "xray.transport.internet.kcp.DownlinkCapacity";
22
- value: number;
23
- }
24
- export interface WriteBuffer {
25
- $type: "xray.transport.internet.kcp.WriteBuffer";
26
- /** Buffer size in bytes. */
27
- size: number;
28
- }
29
- export interface ReadBuffer {
30
- $type: "xray.transport.internet.kcp.ReadBuffer";
31
- /** Buffer size in bytes. */
32
- size: number;
33
- }
34
- export interface ConnectionReuse {
35
- $type: "xray.transport.internet.kcp.ConnectionReuse";
36
- enable: boolean;
37
- }
38
- /**
39
- * Pre-shared secret between client and server. It is used for traffic obfuscation.
40
- * Note that if seed is absent in the config, the traffic will still be obfuscated,
41
- * but by a predefined algorithm.
42
- */
43
- export interface EncryptionSeed {
44
- $type: "xray.transport.internet.kcp.EncryptionSeed";
45
- seed: string;
46
- }
47
- export interface Config {
48
- $type: "xray.transport.internet.kcp.Config";
49
- mtu: MTU | undefined;
50
- tti: TTI | undefined;
51
- uplinkCapacity: UplinkCapacity | undefined;
52
- downlinkCapacity: DownlinkCapacity | undefined;
53
- congestion: boolean;
54
- writeBuffer: WriteBuffer | undefined;
55
- readBuffer: ReadBuffer | undefined;
56
- headerConfig: TypedMessage | undefined;
57
- seed: EncryptionSeed | undefined;
58
- }
59
- export declare const MTU: MessageFns<MTU, "xray.transport.internet.kcp.MTU">;
60
- export declare const TTI: MessageFns<TTI, "xray.transport.internet.kcp.TTI">;
61
- export declare const UplinkCapacity: MessageFns<UplinkCapacity, "xray.transport.internet.kcp.UplinkCapacity">;
62
- export declare const DownlinkCapacity: MessageFns<DownlinkCapacity, "xray.transport.internet.kcp.DownlinkCapacity">;
63
- export declare const WriteBuffer: MessageFns<WriteBuffer, "xray.transport.internet.kcp.WriteBuffer">;
64
- export declare const ReadBuffer: MessageFns<ReadBuffer, "xray.transport.internet.kcp.ReadBuffer">;
65
- export declare const ConnectionReuse: MessageFns<ConnectionReuse, "xray.transport.internet.kcp.ConnectionReuse">;
66
- export declare const EncryptionSeed: MessageFns<EncryptionSeed, "xray.transport.internet.kcp.EncryptionSeed">;
67
- export declare const Config: MessageFns<Config, "xray.transport.internet.kcp.Config">;
68
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
69
- 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 {} ? {
70
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
71
- } : Partial<T>;
72
- export interface MessageFns<T, V extends string> {
73
- readonly $type: V;
74
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
75
- decode(input: BinaryReader | Uint8Array, length?: number): T;
76
- fromJSON(object: any): T;
77
- toJSON(message: T): unknown;
78
- create(base?: DeepPartial<T>): T;
79
- fromPartial(object: DeepPartial<T>): T;
80
- }
81
- export {};
82
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/transport/internet/kcp/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAGpE,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAE7D,2CAA2C;AAC3C,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,iCAAiC,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iDAAiD;AACjD,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,iCAAiC,CAAC;IACzC,KAAK,EAAE,MAAM,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