(cls, ctx: context.Context, send_connect: bool)
| 30 | |
| 31 | @classmethod |
| 32 | def make(cls, ctx: context.Context, send_connect: bool) -> tunnel.LayerStack: |
| 33 | assert ctx.server.via |
| 34 | scheme, address = ctx.server.via |
| 35 | assert scheme in ("http", "https") |
| 36 | |
| 37 | http_proxy = connection.Server(address=address) |
| 38 | |
| 39 | stack = tunnel.LayerStack() |
| 40 | if scheme == "https": |
| 41 | http_proxy.alpn_offers = tls.HTTP1_ALPNS |
| 42 | http_proxy.sni = address[0] |
| 43 | stack /= tls.ServerTLSLayer(ctx, http_proxy) |
| 44 | stack /= cls(ctx, http_proxy, send_connect) |
| 45 | |
| 46 | return stack |
| 47 | |
| 48 | def start_handshake(self) -> layer.CommandGenerator[None]: |
| 49 | if not self.send_connect: |
no outgoing calls
no test coverage detected