| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,14 +44,65 @@ const { | |||
| 44 | 44 | } = require('_http_server'); | |
| 45 | 45 | let maxHeaderSize; | |
| 46 | 46 | ||
| 47 | + /** | ||
| 48 | + * Returns a new instance of `http.Server`. | ||
| 49 | + * @param {{ | ||
| 50 | + * IncomingMessage?: IncomingMessage; | ||
| 51 | + * ServerResponse?: ServerResponse; | ||
| 52 | + * insecureHTTPParser?: boolean; | ||
| 53 | + * maxHeaderSize?: number; | ||
| 54 | + * }} [opts] | ||
| 55 | + * @param {Function} [requestListener] | ||
| 56 | + * @returns {Server} | ||
| 57 | + */ | ||
| 47 | 58 | function createServer(opts, requestListener) { | |
| 48 | 59 | return new Server(opts, requestListener); | |
| 49 | 60 | } | |
| 50 | 61 | ||
| 62 | + /** | ||
| 63 | + * @typedef {Object} HTTPRequestOptions | ||
| 64 | + * @property {httpAgent.Agent | boolean} [agent] | ||
| 65 | + * @property {string} [auth] | ||
| 66 | + * @property {Function} [createConnection] | ||
| 67 | + * @property {number} [defaultPort] | ||
| 68 | + * @property {number} [family] | ||
| 69 | + * @property {Object} [headers] | ||
| 70 | + * @property {number} [hints] | ||
| 71 | + * @property {string} [host] | ||
| 72 | + * @property {string} [hostname] | ||
| 73 | + * @property {boolean} [insecureHTTPParser] | ||
| 74 | + * @property {string} [localAddress] | ||
| 75 | + * @property {number} [localPort] | ||
| 76 | + * @property {Function} [lookup] | ||
| 77 | + * @property {number} [maxHeaderSize] | ||
| 78 | + * @property {string} [method] | ||
| 79 | + * @property {string} [path] | ||
| 80 | + * @property {number} [port] | ||
| 81 | + * @property {string} [protocol] | ||
| 82 | + * @property {boolean} [setHost] | ||
| 83 | + * @property {string} [socketPath] | ||
| 84 | + * @property {number} [timeout] | ||
| 85 | + * @property {AbortSignal} [signal] | ||
| 86 | + */ | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * Makes an HTTP request. | ||
| 90 | + * @param {string | URL} url | ||
| 91 | + * @param {HTTPRequestOptions} [options] | ||
| 92 | + * @param {Function} [cb] | ||
| 93 | + * @returns {ClientRequest} | ||
| 94 | + */ | ||
| 51 | 95 | function request(url, options, cb) { | |
| 52 | 96 | return new ClientRequest(url, options, cb); | |
| 53 | 97 | } | |
| 54 | 98 | ||
| 99 | + /** | ||
| 100 | + * Makes a `GET` HTTP request. | ||
| 101 | + * @param {string | URL} url | ||
| 102 | + * @param {HTTPRequestOptions} [options] | ||
| 103 | + * @param {Function} [cb] | ||
| 104 | + * @returns {ClientRequest} | ||
| 105 | + */ | ||
| 55 | 106 | function get(url, options, cb) { | |
| 56 | 107 | const req = request(url, options, cb); | |
| 57 | 108 | req.end(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments