---
title: "vuer.base"
section: "Core"
order: 1600
description: "Python API reference for vuer.base"
---

# vuer.base

## default_handler

```python
async def default_handler(request, ws)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/base.py#L14)

## websocket_handler

```python
async def websocket_handler(request, handler, **ws_kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/base.py#L19)

## handle_file_request

```python
async def handle_file_request(request, root, filename=None)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/base.py#L42)

## Server

```python
class Server
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/base.py#L74)

Base TCP server with HTTP/WebSocket functionality.

This class provides the core server infrastructure for Vuer, including:
- HTTP route handling with CORS support
- WebSocket connection management
- SSL/TLS support for secure connections
- Static file serving

Subclasses should call _init_app() in their __post_init__ to initialize
the aiohttp application before using server methods.

Note: This class cannot use @proto.prefix because Vuer inherits from it
and also uses @proto.prefix, which causes a metaclass conflict.

Attributes:
    host: Server hostname. Set to "0.0.0.0" to accept remote connections.
    port: Server port number.
    cors: Comma-separated list of allowed CORS origins. Use "*" for all.
    cert: Path to SSL certificate file for HTTPS.
    key: Path to SSL private key file for HTTPS.
    ca_cert: Path to CA certificate for client certificate verification.
    WEBSOCKET_MAX_SIZE: Maximum WebSocket message size (default 256MB).
    REQUEST_MAX_SIZE: Maximum HTTP request size (default 256MB).

```python
host: str = EnvVar @ 'VUER_HOST' | 'localhost'
```

```python
port: int = EnvVar @ 'VUER_PORT' | 8012
```

```python
cors: str = EnvVar @ 'VUER_CORS' | '*'
```

```python
cert: str = EnvVar @ 'VUER_SSL_CERT' | None
```

```python
key: str = EnvVar @ 'VUER_SSL_KEY' | None
```

```python
ca_cert: str = EnvVar @ 'VUER_SSL_CA_CERT' | None
```

```python
WEBSOCKET_MAX_SIZE: int = EnvVar @ 'WEBSOCKET_MAX_SIZE' | 2 ** 28
```

```python
REQUEST_MAX_SIZE: int = EnvVar @ 'REQUEST_MAX_SIZE' | 2 ** 28
```

## Server.start

```python
def start(self)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/base.py#L214)
