1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | declare module 'http2' {
|
12 | import EventEmitter = require('node:events');
|
13 | import * as fs from 'node:fs';
|
14 | import * as net from 'node:net';
|
15 | import * as stream from 'node:stream';
|
16 | import * as tls from 'node:tls';
|
17 | import * as url from 'node:url';
|
18 | import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
|
19 | export { OutgoingHttpHeaders } from 'node:http';
|
20 | export interface IncomingHttpStatusHeader {
|
21 | ':status'?: number | undefined;
|
22 | }
|
23 | export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
|
24 | ':path'?: string | undefined;
|
25 | ':method'?: string | undefined;
|
26 | ':authority'?: string | undefined;
|
27 | ':scheme'?: string | undefined;
|
28 | }
|
29 |
|
30 | export interface StreamPriorityOptions {
|
31 | exclusive?: boolean | undefined;
|
32 | parent?: number | undefined;
|
33 | weight?: number | undefined;
|
34 | silent?: boolean | undefined;
|
35 | }
|
36 | export interface StreamState {
|
37 | localWindowSize?: number | undefined;
|
38 | state?: number | undefined;
|
39 | localClose?: number | undefined;
|
40 | remoteClose?: number | undefined;
|
41 | sumDependencyWeight?: number | undefined;
|
42 | weight?: number | undefined;
|
43 | }
|
44 | export interface ServerStreamResponseOptions {
|
45 | endStream?: boolean | undefined;
|
46 | waitForTrailers?: boolean | undefined;
|
47 | }
|
48 | export interface StatOptions {
|
49 | offset: number;
|
50 | length: number;
|
51 | }
|
52 | export interface ServerStreamFileResponseOptions {
|
53 | statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean;
|
54 | waitForTrailers?: boolean | undefined;
|
55 | offset?: number | undefined;
|
56 | length?: number | undefined;
|
57 | }
|
58 | export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
|
59 | onError?(err: NodeJS.ErrnoException): void;
|
60 | }
|
61 | export interface Http2Stream extends stream.Duplex {
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 | readonly aborted: boolean;
|
68 | |
69 |
|
70 |
|
71 |
|
72 |
|
73 | readonly bufferSize: number;
|
74 | |
75 |
|
76 |
|
77 |
|
78 | readonly closed: boolean;
|
79 | |
80 |
|
81 |
|
82 |
|
83 |
|
84 | readonly destroyed: boolean;
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | readonly endAfterHeaders: boolean;
|
92 | |
93 |
|
94 |
|
95 |
|
96 | readonly id?: number | undefined;
|
97 | |
98 |
|
99 |
|
100 |
|
101 |
|
102 | readonly pending: boolean;
|
103 | |
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | readonly rstCode: number;
|
110 | |
111 |
|
112 |
|
113 |
|
114 | readonly sentHeaders: OutgoingHttpHeaders;
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 | readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined;
|
121 | |
122 |
|
123 |
|
124 |
|
125 | readonly sentTrailers?: OutgoingHttpHeaders | undefined;
|
126 | |
127 |
|
128 |
|
129 |
|
130 |
|
131 | readonly session: Http2Session;
|
132 | |
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | readonly state: StreamState;
|
139 | |
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | close(code?: number, callback?: () => void): void;
|
147 | |
148 |
|
149 |
|
150 |
|
151 | priority(options: StreamPriorityOptions): void;
|
152 | |
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | setTimeout(msecs: number, callback?: () => void): void;
|
165 | |
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 | sendTrailers(headers: OutgoingHttpHeaders): void;
|
190 | addListener(event: 'aborted', listener: () => void): this;
|
191 | addListener(event: 'close', listener: () => void): this;
|
192 | addListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
193 | addListener(event: 'drain', listener: () => void): this;
|
194 | addListener(event: 'end', listener: () => void): this;
|
195 | addListener(event: 'error', listener: (err: Error) => void): this;
|
196 | addListener(event: 'finish', listener: () => void): this;
|
197 | addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this;
|
198 | addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
199 | addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
200 | addListener(event: 'streamClosed', listener: (code: number) => void): this;
|
201 | addListener(event: 'timeout', listener: () => void): this;
|
202 | addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
203 | addListener(event: 'wantTrailers', listener: () => void): this;
|
204 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
205 | emit(event: 'aborted'): boolean;
|
206 | emit(event: 'close'): boolean;
|
207 | emit(event: 'data', chunk: Buffer | string): boolean;
|
208 | emit(event: 'drain'): boolean;
|
209 | emit(event: 'end'): boolean;
|
210 | emit(event: 'error', err: Error): boolean;
|
211 | emit(event: 'finish'): boolean;
|
212 | emit(event: 'frameError', frameType: number, errorCode: number): boolean;
|
213 | emit(event: 'pipe', src: stream.Readable): boolean;
|
214 | emit(event: 'unpipe', src: stream.Readable): boolean;
|
215 | emit(event: 'streamClosed', code: number): boolean;
|
216 | emit(event: 'timeout'): boolean;
|
217 | emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean;
|
218 | emit(event: 'wantTrailers'): boolean;
|
219 | emit(event: string | symbol, ...args: any[]): boolean;
|
220 | on(event: 'aborted', listener: () => void): this;
|
221 | on(event: 'close', listener: () => void): this;
|
222 | on(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
223 | on(event: 'drain', listener: () => void): this;
|
224 | on(event: 'end', listener: () => void): this;
|
225 | on(event: 'error', listener: (err: Error) => void): this;
|
226 | on(event: 'finish', listener: () => void): this;
|
227 | on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this;
|
228 | on(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
229 | on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
230 | on(event: 'streamClosed', listener: (code: number) => void): this;
|
231 | on(event: 'timeout', listener: () => void): this;
|
232 | on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
233 | on(event: 'wantTrailers', listener: () => void): this;
|
234 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
235 | once(event: 'aborted', listener: () => void): this;
|
236 | once(event: 'close', listener: () => void): this;
|
237 | once(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
238 | once(event: 'drain', listener: () => void): this;
|
239 | once(event: 'end', listener: () => void): this;
|
240 | once(event: 'error', listener: (err: Error) => void): this;
|
241 | once(event: 'finish', listener: () => void): this;
|
242 | once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this;
|
243 | once(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
244 | once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
245 | once(event: 'streamClosed', listener: (code: number) => void): this;
|
246 | once(event: 'timeout', listener: () => void): this;
|
247 | once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
248 | once(event: 'wantTrailers', listener: () => void): this;
|
249 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
250 | prependListener(event: 'aborted', listener: () => void): this;
|
251 | prependListener(event: 'close', listener: () => void): this;
|
252 | prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
253 | prependListener(event: 'drain', listener: () => void): this;
|
254 | prependListener(event: 'end', listener: () => void): this;
|
255 | prependListener(event: 'error', listener: (err: Error) => void): this;
|
256 | prependListener(event: 'finish', listener: () => void): this;
|
257 | prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this;
|
258 | prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
259 | prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
260 | prependListener(event: 'streamClosed', listener: (code: number) => void): this;
|
261 | prependListener(event: 'timeout', listener: () => void): this;
|
262 | prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
263 | prependListener(event: 'wantTrailers', listener: () => void): this;
|
264 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
265 | prependOnceListener(event: 'aborted', listener: () => void): this;
|
266 | prependOnceListener(event: 'close', listener: () => void): this;
|
267 | prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
268 | prependOnceListener(event: 'drain', listener: () => void): this;
|
269 | prependOnceListener(event: 'end', listener: () => void): this;
|
270 | prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
271 | prependOnceListener(event: 'finish', listener: () => void): this;
|
272 | prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this;
|
273 | prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
274 | prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
275 | prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this;
|
276 | prependOnceListener(event: 'timeout', listener: () => void): this;
|
277 | prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
278 | prependOnceListener(event: 'wantTrailers', listener: () => void): this;
|
279 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
280 | }
|
281 | export interface ClientHttp2Stream extends Http2Stream {
|
282 | addListener(event: 'continue', listener: () => {}): this;
|
283 | addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
284 | addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
285 | addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
286 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
287 | emit(event: 'continue'): boolean;
|
288 | emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
289 | emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean;
|
290 | emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
291 | emit(event: string | symbol, ...args: any[]): boolean;
|
292 | on(event: 'continue', listener: () => {}): this;
|
293 | on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
294 | on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
295 | on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
296 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
297 | once(event: 'continue', listener: () => {}): this;
|
298 | once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
299 | once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
300 | once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
301 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
302 | prependListener(event: 'continue', listener: () => {}): this;
|
303 | prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
304 | prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
305 | prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
306 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
307 | prependOnceListener(event: 'continue', listener: () => {}): this;
|
308 | prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
309 | prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
310 | prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
311 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
312 | }
|
313 | export interface ServerHttp2Stream extends Http2Stream {
|
314 | |
315 |
|
316 |
|
317 |
|
318 | readonly headersSent: boolean;
|
319 | |
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 | readonly pushAllowed: boolean;
|
326 | |
327 |
|
328 |
|
329 |
|
330 | additionalHeaders(headers: OutgoingHttpHeaders): void;
|
331 | |
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 | pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
|
357 | pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
|
358 | |
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 | respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
|
390 | |
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 | respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
|
467 | |
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 | respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void;
|
566 | }
|
567 |
|
568 | export interface Settings {
|
569 | headerTableSize?: number | undefined;
|
570 | enablePush?: boolean | undefined;
|
571 | initialWindowSize?: number | undefined;
|
572 | maxFrameSize?: number | undefined;
|
573 | maxConcurrentStreams?: number | undefined;
|
574 | maxHeaderListSize?: number | undefined;
|
575 | enableConnectProtocol?: boolean | undefined;
|
576 | }
|
577 | export interface ClientSessionRequestOptions {
|
578 | endStream?: boolean | undefined;
|
579 | exclusive?: boolean | undefined;
|
580 | parent?: number | undefined;
|
581 | weight?: number | undefined;
|
582 | waitForTrailers?: boolean | undefined;
|
583 | signal?: AbortSignal | undefined;
|
584 | }
|
585 | export interface SessionState {
|
586 | effectiveLocalWindowSize?: number | undefined;
|
587 | effectiveRecvDataLength?: number | undefined;
|
588 | nextStreamID?: number | undefined;
|
589 | localWindowSize?: number | undefined;
|
590 | lastProcStreamID?: number | undefined;
|
591 | remoteWindowSize?: number | undefined;
|
592 | outboundQueueSize?: number | undefined;
|
593 | deflateDynamicTableSize?: number | undefined;
|
594 | inflateDynamicTableSize?: number | undefined;
|
595 | }
|
596 | export interface Http2Session extends EventEmitter {
|
597 | |
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 | readonly alpnProtocol?: string | undefined;
|
604 | |
605 |
|
606 |
|
607 |
|
608 | readonly closed: boolean;
|
609 | |
610 |
|
611 |
|
612 |
|
613 |
|
614 | readonly connecting: boolean;
|
615 | |
616 |
|
617 |
|
618 |
|
619 |
|
620 | readonly destroyed: boolean;
|
621 | |
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 | readonly encrypted?: boolean | undefined;
|
629 | |
630 |
|
631 |
|
632 |
|
633 | readonly localSettings: Settings;
|
634 | |
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 | readonly originSet?: string[] | undefined;
|
643 | |
644 |
|
645 |
|
646 |
|
647 |
|
648 | readonly pendingSettingsAck: boolean;
|
649 | |
650 |
|
651 |
|
652 |
|
653 | readonly remoteSettings: Settings;
|
654 | |
655 |
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 | readonly socket: net.Socket | tls.TLSSocket;
|
667 | |
668 |
|
669 |
|
670 |
|
671 |
|
672 |
|
673 | readonly state: SessionState;
|
674 | |
675 |
|
676 |
|
677 |
|
678 |
|
679 |
|
680 | readonly type: number;
|
681 | |
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 | close(callback?: () => void): void;
|
691 | |
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 | destroy(error?: Error, code?: number): void;
|
702 | |
703 |
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 | goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
|
710 | |
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 | ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
|
739 | ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
|
740 | |
741 |
|
742 |
|
743 |
|
744 | ref(): void;
|
745 | |
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 | setLocalWindowSize(windowSize: number): void;
|
764 | |
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 | setTimeout(msecs: number, callback?: () => void): void;
|
771 | |
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 | settings(settings: Settings): void;
|
784 | |
785 |
|
786 |
|
787 |
|
788 | unref(): void;
|
789 | addListener(event: 'close', listener: () => void): this;
|
790 | addListener(event: 'error', listener: (err: Error) => void): this;
|
791 | addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
792 | addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
793 | addListener(event: 'localSettings', listener: (settings: Settings) => void): this;
|
794 | addListener(event: 'ping', listener: () => void): this;
|
795 | addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this;
|
796 | addListener(event: 'timeout', listener: () => void): this;
|
797 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
798 | emit(event: 'close'): boolean;
|
799 | emit(event: 'error', err: Error): boolean;
|
800 | emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean;
|
801 | emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean;
|
802 | emit(event: 'localSettings', settings: Settings): boolean;
|
803 | emit(event: 'ping'): boolean;
|
804 | emit(event: 'remoteSettings', settings: Settings): boolean;
|
805 | emit(event: 'timeout'): boolean;
|
806 | emit(event: string | symbol, ...args: any[]): boolean;
|
807 | on(event: 'close', listener: () => void): this;
|
808 | on(event: 'error', listener: (err: Error) => void): this;
|
809 | on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
810 | on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
811 | on(event: 'localSettings', listener: (settings: Settings) => void): this;
|
812 | on(event: 'ping', listener: () => void): this;
|
813 | on(event: 'remoteSettings', listener: (settings: Settings) => void): this;
|
814 | on(event: 'timeout', listener: () => void): this;
|
815 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
816 | once(event: 'close', listener: () => void): this;
|
817 | once(event: 'error', listener: (err: Error) => void): this;
|
818 | once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
819 | once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
820 | once(event: 'localSettings', listener: (settings: Settings) => void): this;
|
821 | once(event: 'ping', listener: () => void): this;
|
822 | once(event: 'remoteSettings', listener: (settings: Settings) => void): this;
|
823 | once(event: 'timeout', listener: () => void): this;
|
824 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
825 | prependListener(event: 'close', listener: () => void): this;
|
826 | prependListener(event: 'error', listener: (err: Error) => void): this;
|
827 | prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
828 | prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
829 | prependListener(event: 'localSettings', listener: (settings: Settings) => void): this;
|
830 | prependListener(event: 'ping', listener: () => void): this;
|
831 | prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this;
|
832 | prependListener(event: 'timeout', listener: () => void): this;
|
833 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
834 | prependOnceListener(event: 'close', listener: () => void): this;
|
835 | prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
836 | prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
837 | prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
838 | prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this;
|
839 | prependOnceListener(event: 'ping', listener: () => void): this;
|
840 | prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this;
|
841 | prependOnceListener(event: 'timeout', listener: () => void): this;
|
842 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
843 | }
|
844 | export interface ClientHttp2Session extends Http2Session {
|
845 | |
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 | request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
|
886 | addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this;
|
887 | addListener(event: 'origin', listener: (origins: string[]) => void): this;
|
888 | addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
889 | addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
890 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
891 | emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean;
|
892 | emit(event: 'origin', origins: ReadonlyArray<string>): boolean;
|
893 | emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
894 | emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
895 | emit(event: string | symbol, ...args: any[]): boolean;
|
896 | on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this;
|
897 | on(event: 'origin', listener: (origins: string[]) => void): this;
|
898 | on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
899 | on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
900 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
901 | once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this;
|
902 | once(event: 'origin', listener: (origins: string[]) => void): this;
|
903 | once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
904 | once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
905 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
906 | prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this;
|
907 | prependListener(event: 'origin', listener: (origins: string[]) => void): this;
|
908 | prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
909 | prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
910 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
911 | prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this;
|
912 | prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this;
|
913 | prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
914 | prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
915 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
916 | }
|
917 | export interface AlternativeServiceOptions {
|
918 | origin: number | string | url.URL;
|
919 | }
|
920 | export interface ServerHttp2Session extends Http2Session {
|
921 | readonly server: Http2Server | Http2SecureServer;
|
922 | |
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 | altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
|
961 | |
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 |
|
968 |
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 | origin(
|
1006 | ...origins: Array<
|
1007 | | string
|
1008 | | url.URL
|
1009 | | {
|
1010 | origin: string;
|
1011 | }
|
1012 | >
|
1013 | ): void;
|
1014 | addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
1015 | addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1016 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1017 | emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
1018 | emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
1019 | emit(event: string | symbol, ...args: any[]): boolean;
|
1020 | on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
1021 | on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1022 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
1023 | once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
1024 | once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1025 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
1026 | prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
1027 | prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1028 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1029 | prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
1030 | prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1031 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1032 | }
|
1033 |
|
1034 | export interface SessionOptions {
|
1035 | maxDeflateDynamicTableSize?: number | undefined;
|
1036 | maxSessionMemory?: number | undefined;
|
1037 | maxHeaderListPairs?: number | undefined;
|
1038 | maxOutstandingPings?: number | undefined;
|
1039 | maxSendHeaderBlockLength?: number | undefined;
|
1040 | paddingStrategy?: number | undefined;
|
1041 | peerMaxConcurrentStreams?: number | undefined;
|
1042 | settings?: Settings | undefined;
|
1043 | |
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 | unknownProtocolTimeout?: number | undefined;
|
1050 | selectPadding?(frameLen: number, maxFrameLen: number): number;
|
1051 | createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
|
1052 | }
|
1053 | export interface ClientSessionOptions extends SessionOptions {
|
1054 | maxReservedRemoteStreams?: number | undefined;
|
1055 | createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined;
|
1056 | protocol?: 'http:' | 'https:' | undefined;
|
1057 | }
|
1058 | export interface ServerSessionOptions extends SessionOptions {
|
1059 | Http1IncomingMessage?: typeof IncomingMessage | undefined;
|
1060 | Http1ServerResponse?: typeof ServerResponse | undefined;
|
1061 | Http2ServerRequest?: typeof Http2ServerRequest | undefined;
|
1062 | Http2ServerResponse?: typeof Http2ServerResponse | undefined;
|
1063 | }
|
1064 | export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {}
|
1065 | export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {}
|
1066 | export interface ServerOptions extends ServerSessionOptions {}
|
1067 | export interface SecureServerOptions extends SecureServerSessionOptions {
|
1068 | allowHTTP1?: boolean | undefined;
|
1069 | origins?: string[] | undefined;
|
1070 | }
|
1071 | interface HTTP2ServerCommon {
|
1072 | setTimeout(msec?: number, callback?: () => void): this;
|
1073 | /**
|
1074 | * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values.
|
1075 | * Throws ERR_INVALID_ARG_TYPE for invalid settings argument.
|
1076 | */
|
1077 | updateSettings(settings: Settings): void;
|
1078 | }
|
1079 | export interface Http2Server extends net.Server, HTTP2ServerCommon {
|
1080 | addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1081 | addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1082 | addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1083 | addListener(event: 'sessionError', listener: (err: Error) => void): this;
|
1084 | addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1085 | addListener(event: 'timeout', listener: () => void): this;
|
1086 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1087 | emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
1088 | emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
1089 | emit(event: 'session', session: ServerHttp2Session): boolean;
|
1090 | emit(event: 'sessionError', err: Error): boolean;
|
1091 | emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
1092 | emit(event: 'timeout'): boolean;
|
1093 | emit(event: string | symbol, ...args: any[]): boolean;
|
1094 | on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1095 | on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1096 | on(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1097 | on(event: 'sessionError', listener: (err: Error) => void): this;
|
1098 | on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1099 | on(event: 'timeout', listener: () => void): this;
|
1100 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
1101 | once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1102 | once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1103 | once(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1104 | once(event: 'sessionError', listener: (err: Error) => void): this;
|
1105 | once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1106 | once(event: 'timeout', listener: () => void): this;
|
1107 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
1108 | prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1109 | prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1110 | prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1111 | prependListener(event: 'sessionError', listener: (err: Error) => void): this;
|
1112 | prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1113 | prependListener(event: 'timeout', listener: () => void): this;
|
1114 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1115 | prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1116 | prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1117 | prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1118 | prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this;
|
1119 | prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1120 | prependOnceListener(event: 'timeout', listener: () => void): this;
|
1121 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1122 | }
|
1123 | export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon {
|
1124 | addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1125 | addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1126 | addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1127 | addListener(event: 'sessionError', listener: (err: Error) => void): this;
|
1128 | addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1129 | addListener(event: 'timeout', listener: () => void): this;
|
1130 | addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this;
|
1131 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1132 | emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
1133 | emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
1134 | emit(event: 'session', session: ServerHttp2Session): boolean;
|
1135 | emit(event: 'sessionError', err: Error): boolean;
|
1136 | emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
1137 | emit(event: 'timeout'): boolean;
|
1138 | emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean;
|
1139 | emit(event: string | symbol, ...args: any[]): boolean;
|
1140 | on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1141 | on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1142 | on(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1143 | on(event: 'sessionError', listener: (err: Error) => void): this;
|
1144 | on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1145 | on(event: 'timeout', listener: () => void): this;
|
1146 | on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this;
|
1147 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
1148 | once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1149 | once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1150 | once(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1151 | once(event: 'sessionError', listener: (err: Error) => void): this;
|
1152 | once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1153 | once(event: 'timeout', listener: () => void): this;
|
1154 | once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this;
|
1155 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
1156 | prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1157 | prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1158 | prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1159 | prependListener(event: 'sessionError', listener: (err: Error) => void): this;
|
1160 | prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1161 | prependListener(event: 'timeout', listener: () => void): this;
|
1162 | prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this;
|
1163 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1164 | prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1165 | prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
1166 | prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this;
|
1167 | prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this;
|
1168 | prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
1169 | prependOnceListener(event: 'timeout', listener: () => void): this;
|
1170 | prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this;
|
1171 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1172 | }
|
1173 | /**
|
1174 | * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status,
|
1175 | * headers, and
|
1176 | * data.
|
1177 | * @since v8.4.0
|
1178 | */
|
1179 | export class Http2ServerRequest extends stream.Readable {
|
1180 | constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray<string>);
|
1181 | /**
|
1182 | * The `request.aborted` property will be `true` if the request has
|
1183 | * been aborted.
|
1184 | * @since v10.1.0
|
1185 | */
|
1186 | readonly aborted: boolean;
|
1187 | /**
|
1188 | * The request authority pseudo header field. Because HTTP/2 allows requests
|
1189 | * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`.
|
1190 | * @since v8.4.0
|
1191 | */
|
1192 | readonly authority: string;
|
1193 | /**
|
1194 | * See `request.socket`.
|
1195 | * @since v8.4.0
|
1196 | * @deprecated Since v13.0.0 - Use `socket`.
|
1197 | */
|
1198 | readonly connection: net.Socket | tls.TLSSocket;
|
1199 | /**
|
1200 | * The `request.complete` property will be `true` if the request has
|
1201 | * been completed, aborted, or destroyed.
|
1202 | * @since v12.10.0
|
1203 | */
|
1204 | readonly complete: boolean;
|
1205 | /**
|
1206 | * The request/response headers object.
|
1207 | *
|
1208 | * Key-value pairs of header names and values. Header names are lower-cased.
|
1209 | *
|
1210 | * ```js
|
1211 | * // Prints something like:
|
1212 | * //
|
1213 | * // { 'user-agent': 'curl/7.22.0',
|
1214 | * // host: '127.0.0.1:8000',
|
1215 | * // accept: '*' }
|
1216 | * console.log(request.headers);
|
1217 | * ```
|
1218 | *
|
1219 | * See `HTTP/2 Headers Object`.
|
1220 | *
|
1221 | * In HTTP/2, the request path, host name, protocol, and method are represented as
|
1222 | * special headers prefixed with the `:` character (e.g. `':path'`). These special
|
1223 | * headers will be included in the `request.headers` object. Care must be taken not
|
1224 | * to inadvertently modify these special headers or errors may occur. For instance,
|
1225 | * removing all headers from the request will cause errors to occur:
|
1226 | *
|
1227 | * ```js
|
1228 | * removeAllHeaders(request.headers);
|
1229 | * assert(request.url); // Fails because the :path header has been removed
|
1230 | * ```
|
1231 | * @since v8.4.0
|
1232 | */
|
1233 | readonly headers: IncomingHttpHeaders;
|
1234 | /**
|
1235 | * In case of server request, the HTTP version sent by the client. In the case of
|
1236 | * client response, the HTTP version of the connected-to server. Returns`'2.0'`.
|
1237 | *
|
1238 | * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
|
1239 | * @since v8.4.0
|
1240 | */
|
1241 | readonly httpVersion: string;
|
1242 | readonly httpVersionMinor: number;
|
1243 | readonly httpVersionMajor: number;
|
1244 | /**
|
1245 | * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`.
|
1246 | * @since v8.4.0
|
1247 | */
|
1248 | readonly method: string;
|
1249 | /**
|
1250 | * The raw request/response headers list exactly as they were received.
|
1251 | *
|
1252 | * The keys and values are in the same list. It is _not_ a
|
1253 | * list of tuples. So, the even-numbered offsets are key values, and the
|
1254 | * odd-numbered offsets are the associated values.
|
1255 | *
|
1256 | * Header names are not lowercased, and duplicates are not merged.
|
1257 | *
|
1258 | * ```js
|
1259 | * // Prints something like:
|
1260 | * //
|
1261 | * // [ 'user-agent',
|
1262 | * // 'this is invalid because there can be only one',
|
1263 | * // 'User-Agent',
|
1264 | * // 'curl/7.22.0',
|
1265 | * // 'Host',
|
1266 | * // '127.0.0.1:8000',
|
1267 | * // 'ACCEPT',
|
1268 | * // '*' ]
|
1269 | * console.log(request.rawHeaders);
|
1270 | * ```
|
1271 | * @since v8.4.0
|
1272 | */
|
1273 | readonly rawHeaders: string[];
|
1274 | /**
|
1275 | * The raw request/response trailer keys and values exactly as they were
|
1276 | * received. Only populated at the `'end'` event.
|
1277 | * @since v8.4.0
|
1278 | */
|
1279 | readonly rawTrailers: string[];
|
1280 | /**
|
1281 | * The request scheme pseudo header field indicating the scheme
|
1282 | * portion of the target URL.
|
1283 | * @since v8.4.0
|
1284 | */
|
1285 | readonly scheme: string;
|
1286 | /**
|
1287 | * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
|
1288 | * applies getters, setters, and methods based on HTTP/2 logic.
|
1289 | *
|
1290 | * `destroyed`, `readable`, and `writable` properties will be retrieved from and
|
1291 | * set on `request.stream`.
|
1292 | *
|
1293 | * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`.
|
1294 | *
|
1295 | * `setTimeout` method will be called on `request.stream.session`.
|
1296 | *
|
1297 | * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
|
1298 | * more information.
|
1299 | *
|
1300 | * All other interactions will be routed directly to the socket. With TLS support,
|
1301 | * use `request.socket.getPeerCertificate()` to obtain the client's
|
1302 | * authentication details.
|
1303 | * @since v8.4.0
|
1304 | */
|
1305 | readonly socket: net.Socket | tls.TLSSocket;
|
1306 | /**
|
1307 | * The `Http2Stream` object backing the request.
|
1308 | * @since v8.4.0
|
1309 | */
|
1310 | readonly stream: ServerHttp2Stream;
|
1311 | /**
|
1312 | * The request/response trailers object. Only populated at the `'end'` event.
|
1313 | * @since v8.4.0
|
1314 | */
|
1315 | readonly trailers: IncomingHttpHeaders;
|
1316 | /**
|
1317 | * Request URL string. This contains only the URL that is present in the actual
|
1318 | * HTTP request. If the request is:
|
1319 | *
|
1320 | * ```http
|
1321 | * GET /status?name=ryan HTTP/1.1
|
1322 | * Accept: text/plain
|
1323 | * ```
|
1324 | *
|
1325 | * Then `request.url` will be:
|
1326 | *
|
1327 | * ```js
|
1328 | * '/status?name=ryan'
|
1329 | * ```
|
1330 | *
|
1331 | * To parse the url into its parts, `new URL()` can be used:
|
1332 | *
|
1333 | * ```console
|
1334 | * $ node
|
1335 | * > new URL('/status?name=ryan', 'http:
|
1336 | * URL {
|
1337 | * href: 'http:
|
1338 | * origin: 'http:
|
1339 | * protocol: 'http:',
|
1340 | * username: '',
|
1341 | * password: '',
|
1342 | * host: 'example.com',
|
1343 | * hostname: 'example.com',
|
1344 | * port: '',
|
1345 | * pathname: '/status',
|
1346 | * search: '?name=ryan',
|
1347 | * searchParams: URLSearchParams { 'name' => 'ryan' },
|
1348 | * hash: ''
|
1349 | * }
|
1350 | * ```
|
1351 | * @since v8.4.0
|
1352 | */
|
1353 | url: string;
|
1354 | |
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 |
|
1361 |
|
1362 |
|
1363 |
|
1364 | setTimeout(msecs: number, callback?: () => void): void;
|
1365 | read(size?: number): Buffer | string | null;
|
1366 | addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this;
|
1367 | addListener(event: 'close', listener: () => void): this;
|
1368 | addListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
1369 | addListener(event: 'end', listener: () => void): this;
|
1370 | addListener(event: 'readable', listener: () => void): this;
|
1371 | addListener(event: 'error', listener: (err: Error) => void): this;
|
1372 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1373 | emit(event: 'aborted', hadError: boolean, code: number): boolean;
|
1374 | emit(event: 'close'): boolean;
|
1375 | emit(event: 'data', chunk: Buffer | string): boolean;
|
1376 | emit(event: 'end'): boolean;
|
1377 | emit(event: 'readable'): boolean;
|
1378 | emit(event: 'error', err: Error): boolean;
|
1379 | emit(event: string | symbol, ...args: any[]): boolean;
|
1380 | on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this;
|
1381 | on(event: 'close', listener: () => void): this;
|
1382 | on(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
1383 | on(event: 'end', listener: () => void): this;
|
1384 | on(event: 'readable', listener: () => void): this;
|
1385 | on(event: 'error', listener: (err: Error) => void): this;
|
1386 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
1387 | once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this;
|
1388 | once(event: 'close', listener: () => void): this;
|
1389 | once(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
1390 | once(event: 'end', listener: () => void): this;
|
1391 | once(event: 'readable', listener: () => void): this;
|
1392 | once(event: 'error', listener: (err: Error) => void): this;
|
1393 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
1394 | prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this;
|
1395 | prependListener(event: 'close', listener: () => void): this;
|
1396 | prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
1397 | prependListener(event: 'end', listener: () => void): this;
|
1398 | prependListener(event: 'readable', listener: () => void): this;
|
1399 | prependListener(event: 'error', listener: (err: Error) => void): this;
|
1400 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1401 | prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this;
|
1402 | prependOnceListener(event: 'close', listener: () => void): this;
|
1403 | prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this;
|
1404 | prependOnceListener(event: 'end', listener: () => void): this;
|
1405 | prependOnceListener(event: 'readable', listener: () => void): this;
|
1406 | prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
1407 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1408 | }
|
1409 | |
1410 |
|
1411 |
|
1412 |
|
1413 |
|
1414 | export class Http2ServerResponse extends stream.Writable {
|
1415 | constructor(stream: ServerHttp2Stream);
|
1416 | |
1417 |
|
1418 |
|
1419 |
|
1420 |
|
1421 | readonly connection: net.Socket | tls.TLSSocket;
|
1422 | |
1423 |
|
1424 |
|
1425 |
|
1426 |
|
1427 |
|
1428 | readonly finished: boolean;
|
1429 | |
1430 |
|
1431 |
|
1432 |
|
1433 | readonly headersSent: boolean;
|
1434 | |
1435 |
|
1436 |
|
1437 |
|
1438 | readonly req: Http2ServerRequest;
|
1439 | |
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 |
|
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 |
|
1453 |
|
1454 |
|
1455 |
|
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 |
|
1464 |
|
1465 | readonly socket: net.Socket | tls.TLSSocket;
|
1466 | |
1467 |
|
1468 |
|
1469 |
|
1470 | readonly stream: ServerHttp2Stream;
|
1471 | |
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 |
|
1478 |
|
1479 | sendDate: boolean;
|
1480 | |
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 |
|
1491 |
|
1492 |
|
1493 | statusCode: number;
|
1494 | |
1495 |
|
1496 |
|
1497 |
|
1498 |
|
1499 | statusMessage: '';
|
1500 | |
1501 |
|
1502 |
|
1503 |
|
1504 |
|
1505 |
|
1506 |
|
1507 |
|
1508 | addTrailers(trailers: OutgoingHttpHeaders): void;
|
1509 | |
1510 |
|
1511 |
|
1512 |
|
1513 |
|
1514 |
|
1515 |
|
1516 |
|
1517 |
|
1518 |
|
1519 |
|
1520 | end(callback?: () => void): this;
|
1521 | end(data: string | Uint8Array, callback?: () => void): this;
|
1522 | end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this;
|
1523 | |
1524 |
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 |
|
1531 |
|
1532 | getHeader(name: string): string;
|
1533 | |
1534 |
|
1535 |
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 | getHeaderNames(): string[];
|
1547 | |
1548 |
|
1549 |
|
1550 |
|
1551 |
|
1552 |
|
1553 |
|
1554 |
|
1555 |
|
1556 |
|
1557 |
|
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 | getHeaders(): OutgoingHttpHeaders;
|
1568 | |
1569 |
|
1570 |
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 |
|
1577 | hasHeader(name: string): boolean;
|
1578 | |
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 | removeHeader(name: string): void;
|
1587 | |
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 | setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
|
1621 | |
1622 |
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 |
|
1631 | setTimeout(msecs: number, callback?: () => void): void;
|
1632 | |
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 |
|
1659 |
|
1660 | write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
|
1661 | write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean;
|
1662 | |
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 | writeContinue(): void;
|
1668 | |
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 | writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
|
1716 | writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this;
|
1717 | |
1718 |
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 | createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void;
|
1728 | addListener(event: 'close', listener: () => void): this;
|
1729 | addListener(event: 'drain', listener: () => void): this;
|
1730 | addListener(event: 'error', listener: (error: Error) => void): this;
|
1731 | addListener(event: 'finish', listener: () => void): this;
|
1732 | addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
1733 | addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
1734 | addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1735 | emit(event: 'close'): boolean;
|
1736 | emit(event: 'drain'): boolean;
|
1737 | emit(event: 'error', error: Error): boolean;
|
1738 | emit(event: 'finish'): boolean;
|
1739 | emit(event: 'pipe', src: stream.Readable): boolean;
|
1740 | emit(event: 'unpipe', src: stream.Readable): boolean;
|
1741 | emit(event: string | symbol, ...args: any[]): boolean;
|
1742 | on(event: 'close', listener: () => void): this;
|
1743 | on(event: 'drain', listener: () => void): this;
|
1744 | on(event: 'error', listener: (error: Error) => void): this;
|
1745 | on(event: 'finish', listener: () => void): this;
|
1746 | on(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
1747 | on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
1748 | on(event: string | symbol, listener: (...args: any[]) => void): this;
|
1749 | once(event: 'close', listener: () => void): this;
|
1750 | once(event: 'drain', listener: () => void): this;
|
1751 | once(event: 'error', listener: (error: Error) => void): this;
|
1752 | once(event: 'finish', listener: () => void): this;
|
1753 | once(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
1754 | once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
1755 | once(event: string | symbol, listener: (...args: any[]) => void): this;
|
1756 | prependListener(event: 'close', listener: () => void): this;
|
1757 | prependListener(event: 'drain', listener: () => void): this;
|
1758 | prependListener(event: 'error', listener: (error: Error) => void): this;
|
1759 | prependListener(event: 'finish', listener: () => void): this;
|
1760 | prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
1761 | prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
1762 | prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1763 | prependOnceListener(event: 'close', listener: () => void): this;
|
1764 | prependOnceListener(event: 'drain', listener: () => void): this;
|
1765 | prependOnceListener(event: 'error', listener: (error: Error) => void): this;
|
1766 | prependOnceListener(event: 'finish', listener: () => void): this;
|
1767 | prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
|
1768 | prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
|
1769 | prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
1770 | }
|
1771 | export namespace constants {
|
1772 | const NGHTTP2_SESSION_SERVER: number;
|
1773 | const NGHTTP2_SESSION_CLIENT: number;
|
1774 | const NGHTTP2_STREAM_STATE_IDLE: number;
|
1775 | const NGHTTP2_STREAM_STATE_OPEN: number;
|
1776 | const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number;
|
1777 | const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number;
|
1778 | const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number;
|
1779 | const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number;
|
1780 | const NGHTTP2_STREAM_STATE_CLOSED: number;
|
1781 | const NGHTTP2_NO_ERROR: number;
|
1782 | const NGHTTP2_PROTOCOL_ERROR: number;
|
1783 | const NGHTTP2_INTERNAL_ERROR: number;
|
1784 | const NGHTTP2_FLOW_CONTROL_ERROR: number;
|
1785 | const NGHTTP2_SETTINGS_TIMEOUT: number;
|
1786 | const NGHTTP2_STREAM_CLOSED: number;
|
1787 | const NGHTTP2_FRAME_SIZE_ERROR: number;
|
1788 | const NGHTTP2_REFUSED_STREAM: number;
|
1789 | const NGHTTP2_CANCEL: number;
|
1790 | const NGHTTP2_COMPRESSION_ERROR: number;
|
1791 | const NGHTTP2_CONNECT_ERROR: number;
|
1792 | const NGHTTP2_ENHANCE_YOUR_CALM: number;
|
1793 | const NGHTTP2_INADEQUATE_SECURITY: number;
|
1794 | const NGHTTP2_HTTP_1_1_REQUIRED: number;
|
1795 | const NGHTTP2_ERR_FRAME_SIZE_ERROR: number;
|
1796 | const NGHTTP2_FLAG_NONE: number;
|
1797 | const NGHTTP2_FLAG_END_STREAM: number;
|
1798 | const NGHTTP2_FLAG_END_HEADERS: number;
|
1799 | const NGHTTP2_FLAG_ACK: number;
|
1800 | const NGHTTP2_FLAG_PADDED: number;
|
1801 | const NGHTTP2_FLAG_PRIORITY: number;
|
1802 | const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number;
|
1803 | const DEFAULT_SETTINGS_ENABLE_PUSH: number;
|
1804 | const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number;
|
1805 | const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number;
|
1806 | const MAX_MAX_FRAME_SIZE: number;
|
1807 | const MIN_MAX_FRAME_SIZE: number;
|
1808 | const MAX_INITIAL_WINDOW_SIZE: number;
|
1809 | const NGHTTP2_DEFAULT_WEIGHT: number;
|
1810 | const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number;
|
1811 | const NGHTTP2_SETTINGS_ENABLE_PUSH: number;
|
1812 | const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number;
|
1813 | const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number;
|
1814 | const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number;
|
1815 | const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number;
|
1816 | const PADDING_STRATEGY_NONE: number;
|
1817 | const PADDING_STRATEGY_MAX: number;
|
1818 | const PADDING_STRATEGY_CALLBACK: number;
|
1819 | const HTTP2_HEADER_STATUS: string;
|
1820 | const HTTP2_HEADER_METHOD: string;
|
1821 | const HTTP2_HEADER_AUTHORITY: string;
|
1822 | const HTTP2_HEADER_SCHEME: string;
|
1823 | const HTTP2_HEADER_PATH: string;
|
1824 | const HTTP2_HEADER_ACCEPT_CHARSET: string;
|
1825 | const HTTP2_HEADER_ACCEPT_ENCODING: string;
|
1826 | const HTTP2_HEADER_ACCEPT_LANGUAGE: string;
|
1827 | const HTTP2_HEADER_ACCEPT_RANGES: string;
|
1828 | const HTTP2_HEADER_ACCEPT: string;
|
1829 | const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string;
|
1830 | const HTTP2_HEADER_AGE: string;
|
1831 | const HTTP2_HEADER_ALLOW: string;
|
1832 | const HTTP2_HEADER_AUTHORIZATION: string;
|
1833 | const HTTP2_HEADER_CACHE_CONTROL: string;
|
1834 | const HTTP2_HEADER_CONNECTION: string;
|
1835 | const HTTP2_HEADER_CONTENT_DISPOSITION: string;
|
1836 | const HTTP2_HEADER_CONTENT_ENCODING: string;
|
1837 | const HTTP2_HEADER_CONTENT_LANGUAGE: string;
|
1838 | const HTTP2_HEADER_CONTENT_LENGTH: string;
|
1839 | const HTTP2_HEADER_CONTENT_LOCATION: string;
|
1840 | const HTTP2_HEADER_CONTENT_MD5: string;
|
1841 | const HTTP2_HEADER_CONTENT_RANGE: string;
|
1842 | const HTTP2_HEADER_CONTENT_TYPE: string;
|
1843 | const HTTP2_HEADER_COOKIE: string;
|
1844 | const HTTP2_HEADER_DATE: string;
|
1845 | const HTTP2_HEADER_ETAG: string;
|
1846 | const HTTP2_HEADER_EXPECT: string;
|
1847 | const HTTP2_HEADER_EXPIRES: string;
|
1848 | const HTTP2_HEADER_FROM: string;
|
1849 | const HTTP2_HEADER_HOST: string;
|
1850 | const HTTP2_HEADER_IF_MATCH: string;
|
1851 | const HTTP2_HEADER_IF_MODIFIED_SINCE: string;
|
1852 | const HTTP2_HEADER_IF_NONE_MATCH: string;
|
1853 | const HTTP2_HEADER_IF_RANGE: string;
|
1854 | const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string;
|
1855 | const HTTP2_HEADER_LAST_MODIFIED: string;
|
1856 | const HTTP2_HEADER_LINK: string;
|
1857 | const HTTP2_HEADER_LOCATION: string;
|
1858 | const HTTP2_HEADER_MAX_FORWARDS: string;
|
1859 | const HTTP2_HEADER_PREFER: string;
|
1860 | const HTTP2_HEADER_PROXY_AUTHENTICATE: string;
|
1861 | const HTTP2_HEADER_PROXY_AUTHORIZATION: string;
|
1862 | const HTTP2_HEADER_RANGE: string;
|
1863 | const HTTP2_HEADER_REFERER: string;
|
1864 | const HTTP2_HEADER_REFRESH: string;
|
1865 | const HTTP2_HEADER_RETRY_AFTER: string;
|
1866 | const HTTP2_HEADER_SERVER: string;
|
1867 | const HTTP2_HEADER_SET_COOKIE: string;
|
1868 | const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string;
|
1869 | const HTTP2_HEADER_TRANSFER_ENCODING: string;
|
1870 | const HTTP2_HEADER_TE: string;
|
1871 | const HTTP2_HEADER_UPGRADE: string;
|
1872 | const HTTP2_HEADER_USER_AGENT: string;
|
1873 | const HTTP2_HEADER_VARY: string;
|
1874 | const HTTP2_HEADER_VIA: string;
|
1875 | const HTTP2_HEADER_WWW_AUTHENTICATE: string;
|
1876 | const HTTP2_HEADER_HTTP2_SETTINGS: string;
|
1877 | const HTTP2_HEADER_KEEP_ALIVE: string;
|
1878 | const HTTP2_HEADER_PROXY_CONNECTION: string;
|
1879 | const HTTP2_METHOD_ACL: string;
|
1880 | const HTTP2_METHOD_BASELINE_CONTROL: string;
|
1881 | const HTTP2_METHOD_BIND: string;
|
1882 | const HTTP2_METHOD_CHECKIN: string;
|
1883 | const HTTP2_METHOD_CHECKOUT: string;
|
1884 | const HTTP2_METHOD_CONNECT: string;
|
1885 | const HTTP2_METHOD_COPY: string;
|
1886 | const HTTP2_METHOD_DELETE: string;
|
1887 | const HTTP2_METHOD_GET: string;
|
1888 | const HTTP2_METHOD_HEAD: string;
|
1889 | const HTTP2_METHOD_LABEL: string;
|
1890 | const HTTP2_METHOD_LINK: string;
|
1891 | const HTTP2_METHOD_LOCK: string;
|
1892 | const HTTP2_METHOD_MERGE: string;
|
1893 | const HTTP2_METHOD_MKACTIVITY: string;
|
1894 | const HTTP2_METHOD_MKCALENDAR: string;
|
1895 | const HTTP2_METHOD_MKCOL: string;
|
1896 | const HTTP2_METHOD_MKREDIRECTREF: string;
|
1897 | const HTTP2_METHOD_MKWORKSPACE: string;
|
1898 | const HTTP2_METHOD_MOVE: string;
|
1899 | const HTTP2_METHOD_OPTIONS: string;
|
1900 | const HTTP2_METHOD_ORDERPATCH: string;
|
1901 | const HTTP2_METHOD_PATCH: string;
|
1902 | const HTTP2_METHOD_POST: string;
|
1903 | const HTTP2_METHOD_PRI: string;
|
1904 | const HTTP2_METHOD_PROPFIND: string;
|
1905 | const HTTP2_METHOD_PROPPATCH: string;
|
1906 | const HTTP2_METHOD_PUT: string;
|
1907 | const HTTP2_METHOD_REBIND: string;
|
1908 | const HTTP2_METHOD_REPORT: string;
|
1909 | const HTTP2_METHOD_SEARCH: string;
|
1910 | const HTTP2_METHOD_TRACE: string;
|
1911 | const HTTP2_METHOD_UNBIND: string;
|
1912 | const HTTP2_METHOD_UNCHECKOUT: string;
|
1913 | const HTTP2_METHOD_UNLINK: string;
|
1914 | const HTTP2_METHOD_UNLOCK: string;
|
1915 | const HTTP2_METHOD_UPDATE: string;
|
1916 | const HTTP2_METHOD_UPDATEREDIRECTREF: string;
|
1917 | const HTTP2_METHOD_VERSION_CONTROL: string;
|
1918 | const HTTP_STATUS_CONTINUE: number;
|
1919 | const HTTP_STATUS_SWITCHING_PROTOCOLS: number;
|
1920 | const HTTP_STATUS_PROCESSING: number;
|
1921 | const HTTP_STATUS_OK: number;
|
1922 | const HTTP_STATUS_CREATED: number;
|
1923 | const HTTP_STATUS_ACCEPTED: number;
|
1924 | const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number;
|
1925 | const HTTP_STATUS_NO_CONTENT: number;
|
1926 | const HTTP_STATUS_RESET_CONTENT: number;
|
1927 | const HTTP_STATUS_PARTIAL_CONTENT: number;
|
1928 | const HTTP_STATUS_MULTI_STATUS: number;
|
1929 | const HTTP_STATUS_ALREADY_REPORTED: number;
|
1930 | const HTTP_STATUS_IM_USED: number;
|
1931 | const HTTP_STATUS_MULTIPLE_CHOICES: number;
|
1932 | const HTTP_STATUS_MOVED_PERMANENTLY: number;
|
1933 | const HTTP_STATUS_FOUND: number;
|
1934 | const HTTP_STATUS_SEE_OTHER: number;
|
1935 | const HTTP_STATUS_NOT_MODIFIED: number;
|
1936 | const HTTP_STATUS_USE_PROXY: number;
|
1937 | const HTTP_STATUS_TEMPORARY_REDIRECT: number;
|
1938 | const HTTP_STATUS_PERMANENT_REDIRECT: number;
|
1939 | const HTTP_STATUS_BAD_REQUEST: number;
|
1940 | const HTTP_STATUS_UNAUTHORIZED: number;
|
1941 | const HTTP_STATUS_PAYMENT_REQUIRED: number;
|
1942 | const HTTP_STATUS_FORBIDDEN: number;
|
1943 | const HTTP_STATUS_NOT_FOUND: number;
|
1944 | const HTTP_STATUS_METHOD_NOT_ALLOWED: number;
|
1945 | const HTTP_STATUS_NOT_ACCEPTABLE: number;
|
1946 | const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number;
|
1947 | const HTTP_STATUS_REQUEST_TIMEOUT: number;
|
1948 | const HTTP_STATUS_CONFLICT: number;
|
1949 | const HTTP_STATUS_GONE: number;
|
1950 | const HTTP_STATUS_LENGTH_REQUIRED: number;
|
1951 | const HTTP_STATUS_PRECONDITION_FAILED: number;
|
1952 | const HTTP_STATUS_PAYLOAD_TOO_LARGE: number;
|
1953 | const HTTP_STATUS_URI_TOO_LONG: number;
|
1954 | const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number;
|
1955 | const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number;
|
1956 | const HTTP_STATUS_EXPECTATION_FAILED: number;
|
1957 | const HTTP_STATUS_TEAPOT: number;
|
1958 | const HTTP_STATUS_MISDIRECTED_REQUEST: number;
|
1959 | const HTTP_STATUS_UNPROCESSABLE_ENTITY: number;
|
1960 | const HTTP_STATUS_LOCKED: number;
|
1961 | const HTTP_STATUS_FAILED_DEPENDENCY: number;
|
1962 | const HTTP_STATUS_UNORDERED_COLLECTION: number;
|
1963 | const HTTP_STATUS_UPGRADE_REQUIRED: number;
|
1964 | const HTTP_STATUS_PRECONDITION_REQUIRED: number;
|
1965 | const HTTP_STATUS_TOO_MANY_REQUESTS: number;
|
1966 | const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number;
|
1967 | const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number;
|
1968 | const HTTP_STATUS_INTERNAL_SERVER_ERROR: number;
|
1969 | const HTTP_STATUS_NOT_IMPLEMENTED: number;
|
1970 | const HTTP_STATUS_BAD_GATEWAY: number;
|
1971 | const HTTP_STATUS_SERVICE_UNAVAILABLE: number;
|
1972 | const HTTP_STATUS_GATEWAY_TIMEOUT: number;
|
1973 | const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number;
|
1974 | const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number;
|
1975 | const HTTP_STATUS_INSUFFICIENT_STORAGE: number;
|
1976 | const HTTP_STATUS_LOOP_DETECTED: number;
|
1977 | const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number;
|
1978 | const HTTP_STATUS_NOT_EXTENDED: number;
|
1979 | const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number;
|
1980 | }
|
1981 | |
1982 |
|
1983 |
|
1984 |
|
1985 | export const sensitiveHeaders: symbol;
|
1986 | |
1987 |
|
1988 |
|
1989 |
|
1990 |
|
1991 | export function getDefaultSettings(): Settings;
|
1992 | |
1993 |
|
1994 |
|
1995 |
|
1996 |
|
1997 |
|
1998 |
|
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 | export function getPackedSettings(settings: Settings): Buffer;
|
2008 | |
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 | export function getUnpackedSettings(buf: Uint8Array): Settings;
|
2015 | |
2016 |
|
2017 |
|
2018 |
|
2019 |
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 | export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
2045 | export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
2046 | |
2047 |
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 |
|
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 |
|
2072 |
|
2073 |
|
2074 | export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
|
2075 | export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
|
2076 | |
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 |
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 | export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
|
2093 | export function connect(
|
2094 | authority: string | url.URL,
|
2095 | options?: ClientSessionOptions | SecureClientSessionOptions,
|
2096 | listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void
|
2097 | ): ClientHttp2Session;
|
2098 | }
|
2099 | declare module 'node:http2' {
|
2100 | export * from 'http2';
|
2101 | }
|
2102 |
|
\ | No newline at end of file |