---
lang: en
title: 'API docs: testlab.givenhttpserverconfig'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.testlab.givenhttpserverconfig.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/testlab](./testlab.md) &gt; [givenHttpServerConfig](./testlab.givenhttpserverconfig.md)

## givenHttpServerConfig() function

Create an HTTP-server configuration that works well in test environments. - Ask the operating system to assign a free (ephemeral) port. - Use IPv4 localhost `127.0.0.1` to avoid known IPv6 issues in Docker-based environments like Travis-CI. - Provide default TLS key &amp; cert when `protocol` is set to `https`<!-- -->.

<b>Signature:</b>

```typescript
export declare function givenHttpServerConfig<T extends object>(customConfig?: T & {
    protocol?: string;
}): ConfigRetval<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  customConfig | <code>T &amp; {</code><br/><code>    protocol?: string;</code><br/><code>}</code> | Additional configuration options to apply. |

<b>Returns:</b>

`ConfigRetval<T>`


