| 114 | })) |
| 115 | |
| 116 | def start_vhost(self, domains, port=None, doc_root="htdocs", with_ssl=None, |
| 117 | ssl_module=None, with_certificates=None): |
| 118 | super().start_vhost(domains=domains, port=port, doc_root=doc_root, |
| 119 | with_ssl=with_ssl, ssl_module=ssl_module, |
| 120 | with_certificates=with_certificates) |
| 121 | if f"noh2.{self.env.http_tld}" in domains: |
| 122 | protos = ["http/1.1"] |
| 123 | elif port == self.env.https_port or with_ssl is True: |
| 124 | protos = ["h2", "http/1.1"] |
| 125 | else: |
| 126 | protos = ["h2c", "http/1.1"] |
| 127 | if f"test2.{self.env.http_tld}" in domains: |
| 128 | protos = reversed(protos) |
| 129 | self.add(f"Protocols {' '.join(protos)}") |
| 130 | return self |
| 131 | |
| 132 | def add_vhost_noh2(self): |
| 133 | domains = [f"noh2.{self.env.http_tld}", f"noh2-alias.{self.env.http_tld}"] |