RingoJS

Module ringo/httpserver/httpserver

A module containing the HttpServer constructor and its more lowlevel methods

See

build() for easier configuration

HttpServer ()

HttpServer constructor

See


HttpServer.prototype. addContext (context)

Adds a context and starts it

Parameters

Context context

The context to add

Returns

Context

The context passed as argument


HttpServer.prototype. configure (xmlPath)

Configures this instance with the specified jetty.xml configuration file

Parameters

String xmlPath

The path to the jetty.xml configuration file


HttpServer.prototype. createConnector (connectionFactory, options)

Creates a new connector

Parameters

o.e.j.s.HttpConnectionFactory connectionFactory

The connection factory

Object options

An object containing the following properties:

  • host: (String)
  • port: (Number)
  • name: (String) Optional connector name
  • idleTimeout: (Number, defaults to 30000 millis)
  • acceptorPriorityDelta: (Number, defaults to 0)
  • acceptQueueSize: (Number, defaults to 0)

Returns

org.eclipse.jetty.server.ServerConnector


HttpServer.prototype. createHttpConfig (options)

Creates a new HttpConfiguration instance

Parameters

Object options

An object containing the following properties:

  • requestHeaderSize: (Number, default: 8129) The maximum size of request headers allowed
  • outputBufferSize: (Number, default: 32768) Sets the size of the buffer into which response content is aggregated before being sent to the client
  • responseHeaderSize: (Number, default: 8129) The maximum size of response headers
  • sendServerVersion: (boolean, default: false) Includes the Jetty server version in responses
  • sendDateHeader: (boolean, default: true) Enables/disables Date header in responses
  • secureScheme: (String, default: "https") Defines the URI scheme used for confidential and integral redirections

Returns

org.eclipse.jetty.server.HttpConfiguration

HttpServer.prototype. createHttpConnector (options)

Creates a new http connector

Parameters

Object options

An object containing options

Returns

org.eclipse.jetty.server.ServerConnector


HttpServer.prototype. createHttpListener (options)

Creates a new http listener and adds it to the encapsulated jetty http server

Parameters

Object options

see createHttpConnector

Returns

org.eclipse.jetty.server.ServerConnector

HttpServer.prototype. createHttpsConnector (options)

Creates a new https connector

Parameters

Object options

An object containing options (in addition to those passed to createSslContextFactory):

  • sniHostCheck: (boolean, default: true) If true the SNI Host name must match when there is an SNI certificate.
  • stsMaxAgeSeconds: (Number, default: -1) The max age in seconds for a Strict-Transport-Security response header (-1 means no header is sent)
  • stsIncludeSubdomains: (boolean, default: false) If true a include subdomain property is sent with any Strict-Transport-Security header

Returns

org.eclipse.jetty.server.ServerConnector


HttpServer.prototype. createHttpsListener (options)

Creates a new http listener and adds it to the encapsulated jetty http server

Parameters

Object options

see createHttpsConnector

Returns

org.eclipse.jetty.server.ServerConnector

HttpServer.prototype. createSslContextFactory (options)

Creates a new SSL context factory

Parameters

Object options

An object containing options (in addition to those passed to createConnector):

  • verbose: (boolean, default: false) Dump the SSL configuration at startup
  • keyStore: (String) The path to the key store
  • keyStoreType: (String, default: "JKS") The type of keystore
  • keyStorePassword: (String) The key store password
  • keyManagerPassword: (String) The key manager password
  • trustStore: (String, default: options.keyStore) The path to an optional trust store
  • trustStorePassword: (String, default: options.keysStorePassword) The password of the optional trust store
  • includeCipherSuites: (Array, default: []) An array of cipher suites to enable
  • excludeCipherSuites: (Array, default: ["^SSL_.*", "^TLS_DHE_.*", "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA"]) An array of cipher suites to disable
  • includeProtocols: (Array, default: ["TLSv1.2"]) An array containing protocols to support
  • excludeProtocols: (Array, default: null) An array of protocols to exclude
  • allowRenegotiation: (boolean, default: false) Enables TLS renegotiation

Returns

org.eclipse.jetty.util.ssl.SslContextFactory;


HttpServer.prototype. destroy

Destroys the jetty http server



HttpServer.prototype. enableSessions ()

Enables sessions in the jetty server

Returns

org.eclipse.jetty.server.session.DefaultSessionIdManager

HttpServer.prototype. getConnectionStatistics ()

Returns the connection statistics of the jetty server

Returns

Object

An object containing connection statistics


HttpServer.prototype. getContextHandlerCollection ()

Returns the context handler collection of the encapsulated jetty server, instantiating it if it doesn't exist already

Returns

org.eclipse.jetty.server.handler.ContextHandlerCollection

;


HttpServer.prototype. getHandlerCollection ()

Returns the handler collection of the encapsulated jetty server, instantiating it if it doesn't exist already

Returns

org.eclipse.jetty.server.handler.HandlerCollection

;


HttpServer.prototype. isRunning ()

Returns true if the server is running

Returns

boolean

True if the server is running


HttpServer.prototype. serveApplication ()

Returns

Context

HttpServer.prototype. serveStatic ()

Returns

Context

HttpServer.prototype. start

Starts the jetty http server


HttpServer.prototype. stop

Stops the jetty http server