# HTTP configuration (part 2)

Here are the rest of the Liberator configuration items that define how Liberator handles HTTP connections with clients.

**💡 TIP**\
Liberator’s supplied with a built-in HTTP [Config blade](../deployment-framework/cdf-blade-types.md) that’s automatically activated when you install the Liberator (see [Built-in blades](../deployment-framework/cdf-built-in-blades.md)). For more about how to change the configuration of this blade, see How can I... [Configure how Liberator handles HTTP connections](liberator-configure-how-liberator-handles-http-connections.md).

More HTTP-related configuration items can be found in [HTTP Configuration (part 1)](liberator-http-configuration-part-1.md).

## add-authdir

`add-authdir` specifies an HTTP-authenticated directory.

**Syntax**

```
add-authdir
   xref:check-module[check-module]     [type]
   xref:name[name]             [string]
   xref:password[password]         [string array]
   xref:realm[realm]            [string]
   xref:secure-passwords[secure-passwords] [boolean]
   xref:username[username]         [string array]
end-authdir
```

**Options**

* **check-module**

  **Type:** boolean | **Default:** `FALSE`

  When `check-module` is `TRUE`, the Liberator’s [auth module](liberator-user-authentication-and-permissioning.md#how-does-liberator-implement-user-authentication-and-permissioning) is used to authorise a user’s access to the HTTP directory specified in [name](#name), instead of using the list of [username](#username)s and [password](#password)s supplied in this `add-authdir` item.

  For example, if the Auth module is cfgauth, the authorised usernames and passwords are defined in the [username](liberator-cfgauth-configuration.md#username) and [password](liberator-cfgauth-configuration.md#password) options of the cfgauth configuration item [add-user](liberator-cfgauth-configuration.md#add-user).
* **name**

  **Type:** string | **Default:** `/status`

  The full HTTP directory name.

  The default is the Liberator’s status page.
* **password**

  **Type:** string array | **Default:** `admin`

  A space-separated list of passwords. Each password relates to the [username](#username) in the corresponding position in the list. See [Note 1](#note-1) below.

  The passwords can be encrypted in MD5 hash format so that they are secure; in this case, set [secure-passwords](#secure-passwords) to `TRUE`.
* **realm**

  **Type:** string | **Default:** `Liberator Admin`

  The HTTP basic authentication realm. (This string is shown in the Liberator login window that pops up at the client when the login isn’t through [KeyMaster](../keymaster/index.md) single sign-on.)
* **secure-passwords**

  **Type:** boolean | **Default:** `FALSE`

  When `secure-passwords` is `TRUE`, the password received for a [username](#username) is encrypted in MD5 hash format before being validated against the corresponding password defined in the [password](#password) option.
* **username**

  **Type:** string | **Default:** `admin`

  A space-separated list of usernames defining the users who can access the HTTP directory specified in [name](#name).

  See [Note 1](#note-1) below.

**<a name="note-1"></a>Note 1:** You can specify multiple usernames and passwords in the following ways: either as space-separated lists, as individual entries, or a combination of the two.

**Space separated lists**

```
add-authdir
   username   Alf Bill Carl Dave
   password   pwA pwB pwC pwD
end-authdir
```

In the above example user ``Alf`’s password is `pwA`, user ``Bill`’s password is `pwB`, and so on.

**Individual entries**

```
add-authdir
   username   Alf
   password   pwA
   username   Bill
   password   pwB
   username   Carl Dave
   password   pwC pwD
end-authdir
```

In the above example user ``Alf`’s password is still `pwA`, but it’s been specified in a `password` option that immediately follows the `username` option for `Alf`, and similarly for user `Bill` whose password is `pwB`.

## add-useragent

`add-useragent` enables various HTTP protocol extensions for a specific HTTP client or clients, as identified by the client’s user agent string.

**Syntax**

```
add-useragent
   xref:useragent-pattern[useragent-pattern] [string]
   xref:extensions[extensions]        flag1|flag2|flag3|...
end-useragent
```

**Options**

* **useragent-pattern**

  **Type:** string | **Default:** _null_

  A regular expression that Liberator uses to match the user agent string sent to it from an HTTP client.

  For examples of user agent strings, see [User-Agent - HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent) on the Mozilla Developer Network.

  You can also identify the user agent string sent to Liberator from a particular HTTP client by logging into the Liberator from the HTTP client and then looking in the Liberator’s [http-access-log](liberator-http-configuration-part-1.md#http-access-log).
* **extensions**

  **Type:** string | **Default:** _value of [http-extensions](liberator-http-configuration-part-1.md#http-extensions)_

  Flags that enable various HTTP protocol extensions. These flags allow you to turn on HTTP features that can improve utilisation of the client-Liberator connection for HTTP clients whose user agent strings match the value of the [useragent-pattern](#useragent-pattern) option.

  Valid values are as for the [http-extensions](liberator-http-configuration-part-1.md#http-extensions) configuration item.

  For HTTP clients that match [useragent-pattern](#useragent-pattern), the `extensions` option adds to and/or overrides the settings of the [http-extensions](liberator-http-configuration-part-1.md#http-extensions) configuration item.

  You can specify the flags in one extensions option, like this:

  ```
  http-extensions flag1|flag2|flag3
  ```

  or in multiple options, like this:

  ```
  http-extensions flag1
  http-extensions flag2
  http-extensions flag3
  ```

  See the examples below.

**Examples:**

**MSIE (all versions)**

```
add-useragent
   useragent-pattern MSIE
   extensions force-type5-chunked
end-useragent
```

This example enables the `force-type5-chunked` Liberator HTTP extension for requests from all versions of Microsoft Internet Explorer. For more information on this Liberator HTTP extension, see the documentation for the global [http-extensions](liberator-http-configuration-part-1.md#http-extensions) configuration item.

**MSIE (11)**

```
add-useragent
   useragent-pattern "MSIE 11\."
   allow-extensions force-type5-chunked
end-useragent
```

This example enables the `force-type5-chunked` Liberator HTTP extension for requests from Microsoft Internet Explorer 11. For more information on this Liberator HTTP extension, see the documentation for the global [http-extensions](liberator-http-configuration-part-1.md#http-extensions) configuration item.

**Google Chrome (all versions)**

```
add-useragent
   useragent-pattern Chrome
   extensions allow-sse-deflate|allow-ws-permessage-deflate
end-useragent
```

This example enables the `allow-sse-deflate` and `allow-ws-permessage-deflate` Liberator HTTP extensions for connections from all versions of Google Chrome. For more information on these HTTP extensions, see the documentation for the global [http-extensions](liberator-http-configuration-part-1.md#http-extensions) configuration item.

---

**See also:**

* How can I ... [Configure how Liberator handles HTTP connections](liberator-configure-how-liberator-handles-http-connections.md)
* Reference: [HTTP configuration (part 1)](liberator-http-configuration-part-1.md)
* Reference: [HTTPS configuration](liberator-https-configuration.md)
* Reference: [RTTP configuration](liberator-rttp-configuration.md)
