(context: Context, data_client: bytes)
| 405 | |
| 406 | @staticmethod |
| 407 | def _setup_explicit_http_proxy(context: Context, data_client: bytes) -> Layer: |
| 408 | stack = tunnel.LayerStack() |
| 409 | |
| 410 | if context.client.transport_protocol == "udp": |
| 411 | stack /= layers.ClientQuicLayer(context) |
| 412 | elif starts_like_tls_record(data_client): |
| 413 | stack /= layers.ClientTLSLayer(context) |
| 414 | |
| 415 | if isinstance(context.layers[0], modes.HttpUpstreamProxy): |
| 416 | stack /= layers.HttpLayer(context, HTTPMode.upstream) |
| 417 | else: |
| 418 | stack /= layers.HttpLayer(context, HTTPMode.regular) |
| 419 | |
| 420 | return stack[0] |
| 421 | |
| 422 | @staticmethod |
| 423 | def _is_destination_in_hosts(context: Context, hosts: Iterable[re.Pattern]) -> bool: |
no test coverage detected