@@ -95,6 +95,17 @@ ObjectSetPrototypeOf(Server, tls.Server);
95
95
96
96
Server . prototype . setTimeout = HttpServer . prototype . setTimeout ;
97
97
98
+ /**
99
+ * Creates a new `https.Server` instance.
100
+ * @param {{
101
+ * IncomingMessage?: IncomingMessage;
102
+ * ServerResponse?: ServerResponse;
103
+ * insecureHTTPParser?: boolean;
104
+ * maxHeaderSize?: number;
105
+ * }} [opts]
106
+ * @param {Function } [requestListener]
107
+ * @returns {Server }
108
+ */
98
109
function createServer ( opts , requestListener ) {
99
110
return new Server ( opts , requestListener ) ;
100
111
}
@@ -152,7 +163,21 @@ function createConnection(port, host, options) {
152
163
return socket ;
153
164
}
154
165
155
-
166
+ /**
167
+ * Creates a new `HttpAgent` instance.
168
+ * @param {{
169
+ * keepAlive?: boolean;
170
+ * keepAliveMsecs?: number;
171
+ * maxSockets?: number;
172
+ * maxTotalSockets?: number;
173
+ * maxFreeSockets?: number;
174
+ * scheduling?: string;
175
+ * timeout?: number;
176
+ * maxCachedSessions?: number;
177
+ * servername?: string;
178
+ * }} [options]
179
+ * @returns {Agent }
180
+ */
156
181
function Agent ( options ) {
157
182
if ( ! ( this instanceof Agent ) )
158
183
return new Agent ( options ) ;
@@ -173,6 +198,16 @@ ObjectSetPrototypeOf(Agent.prototype, HttpAgent.prototype);
173
198
ObjectSetPrototypeOf ( Agent , HttpAgent ) ;
174
199
Agent . prototype . createConnection = createConnection ;
175
200
201
+ /**
202
+ * Gets a unique name for a set of options.
203
+ * @param {{
204
+ * host: string;
205
+ * port: number;
206
+ * localAddress: string;
207
+ * family: number;
208
+ * }} [options]
209
+ * @returns {string }
210
+ */
176
211
Agent . prototype . getName = function getName ( options ) {
177
212
let name = FunctionPrototypeCall ( HttpAgent . prototype . getName , this , options ) ;
178
213
@@ -297,6 +332,12 @@ Agent.prototype._evictSession = function _evictSession(key) {
297
332
const globalAgent = new Agent ( ) ;
298
333
299
334
let urlWarningEmitted = false ;
335
+
336
+ /**
337
+ * Makes a request to a secure web server.
338
+ * @param {...any } args
339
+ * @returns {ClientRequest }
340
+ */
300
341
function request ( ...args ) {
301
342
let options = { } ;
302
343
@@ -333,6 +374,36 @@ function request(...args) {
333
374
return ReflectConstruct ( ClientRequest , args ) ;
334
375
}
335
376
377
+ /**
378
+ * Makes a GET request to a secure web server.
379
+ * @param {string | URL } input
380
+ * @param {{
381
+ * agent?: Agent | boolean;
382
+ * auth?: string;
383
+ * createConnection?: Function;
384
+ * defaultPort?: number;
385
+ * family?: number;
386
+ * headers?: Object;
387
+ * hints?: number;
388
+ * host?: string;
389
+ * hostname?: string;
390
+ * insecureHTTPParser?: boolean;
391
+ * localAddress?: string;
392
+ * localPort?: number;
393
+ * lookup?: Function;
394
+ * maxHeaderSize?: number;
395
+ * method?: string;
396
+ * path?: string;
397
+ * port?: number;
398
+ * protocol?: string;
399
+ * setHost?: boolean;
400
+ * socketPath?: string;
401
+ * timeout?: number;
402
+ * signal?: AbortSignal;
403
+ * } | string | URL } [options]
404
+ * @param {Function } [cb]
405
+ * @returns {ClientRequest }
406
+ */
336
407
function get ( input , options , cb ) {
337
408
const req = request ( input , options , cb ) ;
338
409
req . end ( ) ;
0 commit comments