| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,6 +94,17 @@ ObjectSetPrototypeOf(Server, tls.Server); | |||
| 94 | 94 | ||
| 95 | 95 | Server.prototype.setTimeout = HttpServer.prototype.setTimeout; | |
| 96 | 96 | ||
| 97 | + /** | ||
| 98 | + * Creates a new `https.Server` instance. | ||
| 99 | + * @param {{ | ||
| 100 | + * IncomingMessage?: IncomingMessage; | ||
| 101 | + * ServerResponse?: ServerResponse; | ||
| 102 | + * insecureHTTPParser?: boolean; | ||
| 103 | + * maxHeaderSize?: number; | ||
| 104 | + * }} [opts] | ||
| 105 | + * @param {Function} [requestListener] | ||
| 106 | + * @returns {Server} | ||
| 107 | + */ | ||
| 97 | 108 | function createServer(opts, requestListener) { | |
| 98 | 109 | return new Server(opts, requestListener); | |
| 99 | 110 | } | |
@@ -151,7 +162,21 @@ function createConnection(port, host, options) { | |||
| 151 | 162 | return socket; | |
| 152 | 163 | } | |
| 153 | 164 | ||
| 154 | - | ||
| 165 | + /** | ||
| 166 | + * Creates a new `HttpAgent` instance. | ||
| 167 | + * @param {{ | ||
| 168 | + * keepAlive?: boolean; | ||
| 169 | + * keepAliveMsecs?: number; | ||
| 170 | + * maxSockets?: number; | ||
| 171 | + * maxTotalSockets?: number; | ||
| 172 | + * maxFreeSockets?: number; | ||
| 173 | + * scheduling?: string; | ||
| 174 | + * timeout?: number; | ||
| 175 | + * maxCachedSessions?: number; | ||
| 176 | + * servername?: string; | ||
| 177 | + * }} [options] | ||
| 178 | + * @returns {Agent} | ||
| 179 | + */ | ||
| 155 | 180 | function Agent(options) { | |
| 156 | 181 | if (!(this instanceof Agent)) | |
| 157 | 182 | return new Agent(options); | |
@@ -172,6 +197,16 @@ ObjectSetPrototypeOf(Agent.prototype, HttpAgent.prototype); | |||
| 172 | 197 | ObjectSetPrototypeOf(Agent, HttpAgent); | |
| 173 | 198 | Agent.prototype.createConnection = createConnection; | |
| 174 | 199 | ||
| 200 | + /** | ||
| 201 | + * Gets a unique name for a set of options. | ||
| 202 | + * @param {{ | ||
| 203 | + * host: string; | ||
| 204 | + * port: number; | ||
| 205 | + * localAddress: string; | ||
| 206 | + * family: number; | ||
| 207 | + * }} [options] | ||
| 208 | + * @returns {string} | ||
| 209 | + */ | ||
| 175 | 210 | Agent.prototype.getName = function getName(options) { | |
| 176 | 211 | let name = FunctionPrototypeCall(HttpAgent.prototype.getName, this, options); | |
| 177 | 212 | ||
@@ -295,6 +330,11 @@ Agent.prototype._evictSession = function _evictSession(key) { | |||
| 295 | 330 | ||
| 296 | 331 | const globalAgent = new Agent(); | |
| 297 | 332 | ||
| 333 | + /** | ||
| 334 | + * Makes a request to a secure web server. | ||
| 335 | + * @param {...any} args | ||
| 336 | + * @returns {ClientRequest} | ||
| 337 | + */ | ||
| 298 | 338 | function request(...args) { | |
| 299 | 339 | let options = {}; | |
| 300 | 340 | ||
@@ -317,6 +357,36 @@ function request(...args) { | |||
| 317 | 357 | return ReflectConstruct(ClientRequest, args); | |
| 318 | 358 | } | |
| 319 | 359 | ||
| 360 | + /** | ||
| 361 | + * Makes a GET request to a secure web server. | ||
| 362 | + * @param {string | URL} input | ||
| 363 | + * @param {{ | ||
| 364 | + * agent?: Agent | boolean; | ||
| 365 | + * auth?: string; | ||
| 366 | + * createConnection?: Function; | ||
| 367 | + * defaultPort?: number; | ||
| 368 | + * family?: number; | ||
| 369 | + * headers?: Object; | ||
| 370 | + * hints?: number; | ||
| 371 | + * host?: string; | ||
| 372 | + * hostname?: string; | ||
| 373 | + * insecureHTTPParser?: boolean; | ||
| 374 | + * localAddress?: string; | ||
| 375 | + * localPort?: number; | ||
| 376 | + * lookup?: Function; | ||
| 377 | + * maxHeaderSize?: number; | ||
| 378 | + * method?: string; | ||
| 379 | + * path?: string; | ||
| 380 | + * port?: number; | ||
| 381 | + * protocol?: string; | ||
| 382 | + * setHost?: boolean; | ||
| 383 | + * socketPath?: string; | ||
| 384 | + * timeout?: number; | ||
| 385 | + * signal?: AbortSignal; | ||
| 386 | + * } | string | URL} [options] | ||
| 387 | + * @param {Function} [cb] | ||
| 388 | + * @returns {ClientRequest} | ||
| 389 | + */ | ||
| 320 | 390 | function get(input, options, cb) { | |
| 321 | 391 | const req = request(input, options, cb); | |
| 322 | 392 | req.end(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments