Vuer

vuer.base

default_handler

python
async def default_handler(request, ws)

Source

websocket_handler

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

Source

handle_file_request

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

Source

Server

python
class Server

Source

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