HttpProxy

@unitybase/http-proxy~ HttpProxy

new HttpProxy(config)

Arguments:
  1. config (Object)
    Properties
    1. endpoint (string)  Proxy endpoint name
    2. targetURL (string)  A URL of target server we reverse requests to
    3. [compressionEnable=false] (boolean)  Use gzip compression of request body
    4. [sendTimeout=30000] (Number)  Send timeout in ms.
    5. [receiveTimeout=30000] (Number)  Receive timeout in ms.
    6. [connectTimeout=30000] (Number)  Connect timeout in ms.
    7. [nonAuthorizedURLs] (Array.<RegExp>)  Array of regular expression for URL what not require a authentication
    8. [authorizedURLs] (Array.<RegExp>)  Array of regular expression for URL what require a authentication. If set this parameter will be ignored parameter nonAuthorizedURLs
    9. [authorizedRole] (string|Array.<string>)  Authorize only user with role(s)

Methods

processRequest(req, resp)

Handle a proxy request
Arguments:
  1. req (THTTPRequest)
  2. resp (THTTPResponse)