---
lang: en
title: 'API docs: http-server.httpserver'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/http-server
permalink: /doc/en/lb4/apidocs.http-server.httpserver.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/http-server](./http-server.md) &gt; [HttpServer](./http-server.httpserver.md)

## HttpServer class

HTTP / HTTPS server used by LoopBack's RestServer

**Signature:**

```typescript
export declare class HttpServer 
```

## Constructors

<table><thead><tr><th>

Constructor


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[(constructor)(requestListener, serverOptions)](./http-server.httpserver._constructor_.md)


</td><td>


</td><td>

Constructs a new instance of the `HttpServer` class


</td></tr>
</tbody></table>

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[address](./http-server.httpserver.address.md)


</td><td>

`readonly`


</td><td>

string \| AddressInfo \| undefined


</td><td>

Address of the HTTP / HTTPS server


</td></tr>
<tr><td>

[host](./http-server.httpserver.host.md)


</td><td>

`readonly`


</td><td>

string \| undefined


</td><td>

Host of the HTTP / HTTPS server


</td></tr>
<tr><td>

[listening](./http-server.httpserver.listening.md)


</td><td>

`readonly`


</td><td>

boolean


</td><td>

State of the HTTP / HTTPS server


</td></tr>
<tr><td>

[port](./http-server.httpserver.port.md)


</td><td>

`readonly`


</td><td>

number


</td><td>

Port number of the HTTP / HTTPS server


</td></tr>
<tr><td>

[protocol](./http-server.httpserver.protocol.md)


</td><td>

`readonly`


</td><td>

[HttpProtocol](./http-server.httpprotocol.md)


</td><td>

Protocol of the HTTP / HTTPS server


</td></tr>
<tr><td>

[server](./http-server.httpserver.server.md)


</td><td>

`readonly`


</td><td>

http.Server \| https.Server


</td><td>


</td></tr>
<tr><td>

[serverOptions](./http-server.httpserver.serveroptions.md)


</td><td>

`readonly`


</td><td>

[HttpServerOptions](./http-server.httpserveroptions.md)


</td><td>


</td></tr>
<tr><td>

[url](./http-server.httpserver.url.md)


</td><td>

`readonly`


</td><td>

string


</td><td>

URL of the HTTP / HTTPS server


</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[start()](./http-server.httpserver.start.md)


</td><td>


</td><td>

Starts the HTTP / HTTPS server


</td></tr>
<tr><td>

[stop()](./http-server.httpserver.stop.md)


</td><td>


</td><td>

Stops the HTTP / HTTPS server


</td></tr>
</tbody></table>

