***

title: start
slug: /reference/python/agents/web-service/start
description: Start the HTTP server with optional HTTPS support.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[securityconfig]: /docs/server-sdks/reference/python/agents/configuration/security-config

Start the HTTP server. Blocks until the server is stopped. Raises
`RuntimeError` if FastAPI or uvicorn are not available.

When `ssl_cert` and `ssl_key` are provided, the server starts with HTTPS.
Otherwise, SSL configuration is loaded from the
[`SecurityConfig`][securityconfig]
environment variables.

## **Parameters**

<ParamField path="host" type="str" default="0.0.0.0" toc={true}>
  Host address to bind to.
</ParamField>

<ParamField path="port" type="Optional[int]" toc={true}>
  Port to bind to. Defaults to the `port` set in the constructor.
</ParamField>

<ParamField path="ssl_cert" type="Optional[str]" toc={true}>
  Path to an SSL certificate file. Overrides environment-based SSL
  configuration.
</ParamField>

<ParamField path="ssl_key" type="Optional[str]" toc={true}>
  Path to an SSL key file. Overrides environment-based SSL configuration.
</ParamField>

## **Returns**

`None` -- This method blocks and does not return until the server is stopped.

## **Example**

```python {9}
from signalwire import WebService

web = WebService(
    port=8002,
    directories={"/recordings": "./recordings"},
    basic_auth=("admin", "secret"),
    enable_directory_browsing=True
)
web.start(host="0.0.0.0", port=8002)
```

### With HTTPS

```python {7}
from signalwire import WebService

web = WebService(
    port=443,
    directories={"/assets": "./public"}
)
web.start(ssl_cert="cert.pem", ssl_key="key.pem")
```