@gjsify/http 0.3.13 → 0.3.14

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.
@@ -1,71 +1,71 @@
1
1
  import { Duplex } from "node:stream";
2
- class ServerRequestSocket extends Duplex {
3
- remoteAddress;
4
- remotePort;
5
- localAddress;
6
- localPort;
7
- remoteFamily = "IPv4";
8
- encrypted;
9
- connecting = false;
10
- pending = false;
11
- bytesRead = 0;
12
- bytesWritten = 0;
13
- // Bridge response we forward pause/resume to (via super.pause/resume
14
- // for now; the bridge will grow explicit pause/unpause hooks later).
15
- _bridgeRes;
16
- _bridgePaused = false;
17
- constructor(remoteAddress, remotePort, localAddress, localPort, bridgeRes, encrypted = false) {
18
- super({ allowHalfOpen: true });
19
- this.remoteAddress = remoteAddress;
20
- this.remotePort = remotePort;
21
- this.localAddress = localAddress;
22
- this.localPort = localPort;
23
- this.encrypted = encrypted;
24
- this._bridgeRes = bridgeRes;
25
- }
26
- pause() {
27
- if (this._bridgePaused) return this;
28
- this._bridgePaused = true;
29
- return super.pause();
30
- }
31
- resume() {
32
- if (!this._bridgePaused) return super.resume();
33
- this._bridgePaused = false;
34
- return super.resume();
35
- }
36
- // The bridge owns the TCP connection — no data flows through this Duplex.
37
- _read(_size) {
38
- }
39
- _write(_chunk, _encoding, cb) {
40
- cb();
41
- }
42
- destroySoon() {
43
- if (!this.writableEnded) this.end();
44
- if (this.writableFinished)
45
- this.destroy();
46
- else
47
- this.once("finish", () => this.destroy());
48
- }
49
- setTimeout(_timeout, cb) {
50
- if (cb) this.once("timeout", cb);
51
- return this;
52
- }
53
- setNoDelay(_noDelay) {
54
- return this;
55
- }
56
- setKeepAlive(_enable, _delay) {
57
- return this;
58
- }
59
- ref() {
60
- return this;
61
- }
62
- unref() {
63
- return this;
64
- }
65
- address() {
66
- return { address: this.localAddress, family: "IPv4", port: this.localPort };
67
- }
68
- }
69
- export {
70
- ServerRequestSocket
2
+
3
+ //#region src/server-request-socket.ts
4
+ var ServerRequestSocket = class extends Duplex {
5
+ remoteAddress;
6
+ remotePort;
7
+ localAddress;
8
+ localPort;
9
+ remoteFamily = "IPv4";
10
+ encrypted;
11
+ connecting = false;
12
+ pending = false;
13
+ bytesRead = 0;
14
+ bytesWritten = 0;
15
+ _bridgeRes;
16
+ _bridgePaused = false;
17
+ constructor(remoteAddress, remotePort, localAddress, localPort, bridgeRes, encrypted = false) {
18
+ super({ allowHalfOpen: true });
19
+ this.remoteAddress = remoteAddress;
20
+ this.remotePort = remotePort;
21
+ this.localAddress = localAddress;
22
+ this.localPort = localPort;
23
+ this.encrypted = encrypted;
24
+ this._bridgeRes = bridgeRes;
25
+ }
26
+ pause() {
27
+ if (this._bridgePaused) return this;
28
+ this._bridgePaused = true;
29
+ return super.pause();
30
+ }
31
+ resume() {
32
+ if (!this._bridgePaused) return super.resume();
33
+ this._bridgePaused = false;
34
+ return super.resume();
35
+ }
36
+ _read(_size) {}
37
+ _write(_chunk, _encoding, cb) {
38
+ cb();
39
+ }
40
+ destroySoon() {
41
+ if (!this.writableEnded) this.end();
42
+ if (this.writableFinished) this.destroy();
43
+ else this.once("finish", () => this.destroy());
44
+ }
45
+ setTimeout(_timeout, cb) {
46
+ if (cb) this.once("timeout", cb);
47
+ return this;
48
+ }
49
+ setNoDelay(_noDelay) {
50
+ return this;
51
+ }
52
+ setKeepAlive(_enable, _delay) {
53
+ return this;
54
+ }
55
+ ref() {
56
+ return this;
57
+ }
58
+ unref() {
59
+ return this;
60
+ }
61
+ address() {
62
+ return {
63
+ address: this.localAddress,
64
+ family: "IPv4",
65
+ port: this.localPort
66
+ };
67
+ }
71
68
  };
69
+
70
+ //#endregion
71
+ export { ServerRequestSocket };