(self, reader: asyncio.StreamReader,
writer: asyncio.StreamWriter)
| 513 | pass |
| 514 | |
| 515 | async def _on_socks_client(self, reader: asyncio.StreamReader, |
| 516 | writer: asyncio.StreamWriter): |
| 517 | addr = writer.get_extra_info("peername") |
| 518 | task = self._track_current_task() |
| 519 | try: |
| 520 | result = await negotiate_socks5(reader, writer) |
| 521 | if result is None: |
| 522 | return |
| 523 | host, port = result |
| 524 | log.info("SOCKS5 CONNECT → %s:%d", host, port) |
| 525 | await self._handle_target_tunnel(host, port, reader, writer) |
| 526 | except asyncio.IncompleteReadError: |
| 527 | pass |
| 528 | except asyncio.CancelledError: |
| 529 | pass |
| 530 | except asyncio.TimeoutError: |
| 531 | log.debug("SOCKS5 timeout: %s", addr) |
| 532 | except Exception as e: |
| 533 | log.error("SOCKS5 error (%s): %s", addr, e) |
| 534 | finally: |
| 535 | self._untrack_task(task) |
| 536 | try: |
| 537 | writer.close() |
| 538 | await writer.wait_closed() |
| 539 | except Exception: |
| 540 | pass |
| 541 | |
| 542 | # ── CONNECT (HTTPS tunnelling) ──────────────────────────────── |
| 543 |
nothing calls this directly
no test coverage detected