Table of Contents


This module exports configuration of the Hop server running instance.

require( require( 'hop' ).config ) to use the module.


The following read-only properties are established when Hop is configured.


The share directory of the Hop installation.

console.log( "share:", config.shareDir );


The bin directory of the Hop installation.

console.log( "bin:", config.binDir );


The lib directory of the Hop installation.

console.log( "lib:", config.libDir );


The `modules` directory of the Hop installation._node

console.log( "modules:", config.modulesDir );

Initialization Settings

The server properties defined below are set either in the Hop.js launch arguments or in the hoprc.js configuration file, before the implicit http server is activated. Setting the properties later would have no effect on the running http server.

Values specified in the hoprc.js file overwrite command line arguments.



These two properties are read-only. Their values are defined after command line arguments. These properties specify which protocol is activated (default is HTTP) and the port number for this protocol. Currently, at least one property has the value undefined as a Hop.js server cannot run both protocols in a single instance.

When the special value 0 was given at launch time for either property, the system randomly selects an available port and sets the property accordingly.

The hop.portproperty is equal to config.HTTPPortif this property is defined, or to config.HTTPSPort.

var hop = require( 'hop' );
var config = require( hop.config );
if ( config.HTTPSPort ) {
        console.log( 'Server is running HTTPS on port:', config.HTTPSPort );


The server known aliases. This parameter is used to separate local requests from remote requests.

console.log( "server aliases:", config.serverAliases );


Hop's authentication mode. Can either be basic or digest. These two modes are described in the RFC 7235


The path of the private key when https is enabled.

console.log( "https private key:", config.HTTPSPrivateKey );


The path of the certificate when https is enabled.

console.log( "https private key:", config.HTTPSCertificate );


Maximum number of native threads used by the server.

console.log( "threads:", config.maxThreads );


Default HTML backend for generating document.

console.log( "html:", config.xmlBackend );


Enable or disable Webdav support.

console.log( "webdav:", config.enableWebdav );


Enable or disable Keepalive support.

console.log( "keep-alive:", config.enableKeepAlive );

Global configuration

The following properties describe the state of the running Hop. They can be changed dynamically.


The locale of the host running the Hop server.


The character set used to compile XML nodes into HTML.