MCPcopy
hub / github.com/webpack/webpack-dev-server / getHostname

Method getHostname

lib/Server.js:504–516  ·  view source on GitHub ↗

* @param {Host} hostname hostname * @returns {Promise } resolved hostname

(hostname)

Source from the content-addressed store, hash-verified

502 * @returns {Promise<string>} resolved hostname
503 */
504 static async getHostname(hostname) {
505 if (hostname === "local-ip") {
506 return (
507 Server.findIp("v4", false) || Server.findIp("v6", false) || "0.0.0.0"
508 );
509 } else if (hostname === "local-ipv4") {
510 return Server.findIp("v4", false) || "0.0.0.0";
511 } else if (hostname === "local-ipv6") {
512 return Server.findIp("v6", false) || "::";
513 }
514
515 return hostname;
516 }
517
518 /**
519 * @param {Port} port port

Callers 1

setupMethod · 0.80

Calls 1

findIpMethod · 0.80

Tested by

no test coverage detected