VirtualHost constructor

VirtualHost([
  1. Stream<HttpRequest>? source
])

Construct an VirtualHost with an optional initial source.

The optional source is a shortcut for calling addSource.

Example

var server = await HttpServer.bind(..., 80);
var virtualHost = VirtualHost(server);
virtualServer.addHost('static.myserver.com').listen(...);
virtualServer.addHost('cache.myserver.com').listen(...);

Implementation

factory VirtualHost([Stream<HttpRequest>? source]) => _VirtualHost(source);