API Docs for:
Show:

http_proxy Class

Module: http_proxy

Provides the HTTP proxy server.

Methods

config

(
  • path
)

Configure the HTTP proxy properties and the router url mappings. The file must use the JSON syntax.

The method can throw an Exception.

Parameters:

  • path String

    The path of the configuration file

getProxyLog

(
  • req
)
String private

Returns the string to log the REST request.

Parameters:

  • req Object

    The request object

Returns:

String:

The string describing the REST request.

setCompAstProxy

(
  • comp
)

Set the asterisk proxy architect component.

Parameters:

  • comp Object

    The asterisk proxy architect component.

setCompAuthentication

(
  • comp
)

Sets the authentication architect component.

Parameters:

  • comp Object

    The authentication architect component.

setCompUser

(
  • comp
)
private

Set user module to be used.

Parameters:

  • comp Object

    The user module

setCompUtil

(
  • comp
)

Sets the utility architect component.

Parameters:

  • comp Object

    The utility architect component.

setLogger

(
  • log
)
static

Set the logger to be used.

Parameters:

  • log Object

    The logger object. It must have at least three methods: info, warn and error as console object.

start

() static

Starts the HTTP proxy server.

Properties

address

String private final

Listening address of the HTTP proxy server.

Default: "localhost"

compAstProxy

Object private

The asterisk proxy architect component.

compAuthentication

Object private

The authentication architect component.

compUser

Object private

The user module.

compUtil

Object private

The utility architect component.

httpServer

Object private

The HTTP server to be used with proxy.

IDLOG

String private final

The module identifier used by the logger.

Default: [http_proxy]

logger

Object private

The logger. It must have at least three methods: info, warn and error.

Default: console

port

String private

Listening port of the HTTP proxy server. It can be customized in the configuration file.

router

Object private

The routing of the HTTP proxy. It's initialized by the config method. It must be customized in the configuration file.

Default: {}