MOON
Server: Apache
System: Linux 54-179-220-51.cprapid.com 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
User: thehunarfound (1001)
PHP: 7.4.29
Disabled: NONE
Upload Files
File: /home/thehunarfound/public_html/DMSold/node_modules/webpack-dev-server/lib/util/createDomain.js
'use strict';

const url = require('url');
const internalIp = require('internal-ip');


module.exports = function createDomain(options, listeningApp) {
  const protocol = options.https ? 'https' : 'http';
  const appPort = listeningApp ? listeningApp.address().port : 0;
  const port = options.socket ? 0 : appPort;
  const hostname = options.useLocalIp ? internalIp.v4() : options.host;

  // use explicitly defined public url (prefix with protocol if not explicitly given)
  if (options.public) {
    return /^[a-zA-Z]+:\/\//.test(options.public) ? `${options.public}` : `${protocol}://${options.public}`;
  }
  // the formatted domain (url without path) of the webpack server
  return url.format({
    protocol,
    hostname,
    port
  });
};
;;