ports property
More ports for the same app, each with its own http2 and tls.
Use it when one process must serve plain HTTP and HTTPS together,
eg. HTTPS for the public and a plain port for a health check. Each
isolate listens on serverPort, on the additionalPorts and on
each of these, with the same routes. http2 and tls are not used
for these ports: each PortConfig has its own. The limits
(maxConnections, idleTimeout and the others) are the ones of the
app. req.scheme() is https only for a request that came on a
port with tls. A port that is listed two times throws an
ArgumentError when the server starts. The test client
(DoxTestClient) does not listen on these. Native server only.
Default: none.
serverPort: 8080,
ports: <PortConfig>[
PortConfig(8443, http2: true, tls: TlsOptions(
certificatePath: 'cert.pem',
keyPath: 'key.pem',
)),
],
Implementation
final List<PortConfig> ports;