@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
296 lines (133 loc) • 3.69 kB
Markdown
---
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) > [@loopback/http-server](./http-server.md) > [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 markdown="1">
[(constructor)(requestListener, serverOptions)](./http-server.httpserver._constructor_.md)
</td><td markdown="1">
</td><td markdown="1">
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 markdown="1">
[address](./http-server.httpserver.address.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
string \| AddressInfo \| undefined
</td><td markdown="1">
Address of the HTTP / HTTPS server
</td></tr>
<tr><td markdown="1">
[host](./http-server.httpserver.host.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
string \| undefined
</td><td markdown="1">
Host of the HTTP / HTTPS server
</td></tr>
<tr><td markdown="1">
[listening](./http-server.httpserver.listening.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
boolean
</td><td markdown="1">
State of the HTTP / HTTPS server
</td></tr>
<tr><td markdown="1">
[port](./http-server.httpserver.port.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
number
</td><td markdown="1">
Port number of the HTTP / HTTPS server
</td></tr>
<tr><td markdown="1">
[protocol](./http-server.httpserver.protocol.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
[HttpProtocol](./http-server.httpprotocol.md)
</td><td markdown="1">
Protocol of the HTTP / HTTPS server
</td></tr>
<tr><td markdown="1">
[server](./http-server.httpserver.server.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
http.Server \| https.Server
</td><td markdown="1">
</td></tr>
<tr><td markdown="1">
[serverOptions](./http-server.httpserver.serveroptions.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
[HttpServerOptions](./http-server.httpserveroptions.md)
</td><td markdown="1">
</td></tr>
<tr><td markdown="1">
[url](./http-server.httpserver.url.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
string
</td><td markdown="1">
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 markdown="1">
[start()](./http-server.httpserver.start.md)
</td><td markdown="1">
</td><td markdown="1">
Starts the HTTP / HTTPS server
</td></tr>
<tr><td markdown="1">
[stop()](./http-server.httpserver.stop.md)
</td><td markdown="1">
</td><td markdown="1">
Stops the HTTP / HTTPS server
</td></tr>
</tbody></table>