public function __construct(NetworkComponentAwareInterface $aware = null, $params = [])
{
$this->routes = isset($params['routes']) && $params['routes'] instanceof RouteCollection ? $params['routes'] : new RouteCollection();
$this->context = isset($params['context']) && $params['context'] instanceof RequestContext ? $params['context'] : new RequestContext();
$this->matcher = new UrlMatcher($this->routes, $this->context);
$this->host = isset($params['host']) ? $params['host'] : 'localhost';
$this->checkOrigin = isset($params['checkOrigin']) ? $params['checkOrigin'] : false;
$this->allowedOrigins = [];
if ($aware !== null) {
$aware->setComponent($this);
}
}