Assign the IP and port on which to listen
The address may be any valid IPv4 or IPv6 address. The "0.0.0.0" indicates "all IPv4 interfaces" and is appropriate for most users. Use "::" to indicate "all IPv6 interfaces". To indicate "all IPv4 and IPv6 interfaces", use a "*" wildcard character.
Note that "::" may also listen on some systems on IPv4 interfaces. PHP currently does not expose the IPV6_V6ONLY constant.
Any valid port number [1-65535] may be used. Port numbers lower than 256 are reserved for well-known services (like HTTP on port 80) and port numbers less than 1024 require root access on UNIX-like systems. The default port for encrypted sockets (https) is 443. If you plan to use encryption with this host you'll generally want to use port 443.
|string||$address||The IPv4 or IPv6 interface to listen to||none|
|int||$port||The port number on which to listen||none|
Assign a domain name (e.g. localhost or mysite.com or subdomain.mysite.com)
A host name is only required if a server exposes more than one host. If a name is not defined the server will default to "localhost"
Use a callable request action or Middleware
Host actions are invoked to service requests in the order in which they are added.
Define TLS encryption settings for this host
|string||$certificate||A string path pointing to your SSL/TLS certificate||none|
|string|null||$key||A string path pointing to your SSL/TLS key file (null if the certificate file is containing the key already)||null|
|array||$options||An optional array mapping additional SSL/TLS settings|||
Redirect all requests that aren't serviced by an action callable
NOTE: the redirect URI must match the format "scheme://hostname.tld" (with optional port and path).
The following example redirects all unencrypted requests to the equivalent encrypted resource:
<?php // Redirect http://mysite.com to https://mysite.com $host = new Aerys\Host; $host->setName("mysite.com"); $host->redirect("https://mysite.com");
|string||$absoluteUri||The location to which we wish to redirect||none|
|int||$redirectCode||The HTTP redirect status code (300-399)||307|
Retrieve an associative array summarizing the host definition
Used by the server bootstrapper to access host configs created by the application