Skip to content

Connection lost before connect to HTTP Proxy #738

Discussion options

You must be logged in to vote

I leave here a message to make it easier to find.

@ronf has discovered that as of python 3.11 the asyncio.StreamWriter closes the connection when destroyed.
So you have to change the implementation to make it work.

Here is an example of the implementation in case it is useful for someone in the future:

import asyncio
import re
from pprint import pprint

import asyncssh


class HTTPProxyTunnel:
    """HTTP Proxy Tunner."""

    def __init__(self, proxy_host: str, proxy_port: int) -> None:
        """HTTP Proxy Tunner.

        Args:
            proxy_host: Proxy Host
            proxy_port: Proxy Port
        """
        self.__proxy_host: str = proxy_host
        self.__proxy_port: int = p…

Replies: 5 comments 20 replies

Comment options

You must be logged in to vote
2 replies
@ronf
Comment options

ronf Feb 26, 2025
Maintainer

@jmencianaranjo-ionos
Comment options

Comment options

You must be logged in to vote
7 replies
@jmencianaranjo-ionos
Comment options

@ronf
Comment options

ronf Feb 26, 2025
Maintainer

@jmencianaranjo-ionos
Comment options

@ronf
Comment options

ronf Feb 26, 2025
Maintainer

@jmencianaranjo-ionos
Comment options

Comment options

You must be logged in to vote
5 replies
@jmencianaranjo-ionos
Comment options

@ronf
Comment options

ronf Feb 27, 2025
Maintainer

@jmencianaranjo-ionos
Comment options

@jmencianaranjo-ionos
Comment options

@jmencianaranjo-ionos
Comment options

Comment options

You must be logged in to vote
5 replies
@ronf
Comment options

ronf Mar 1, 2025
Maintainer

@jmencianaranjo-ionos
Comment options

@ronf
Comment options

ronf Mar 2, 2025
Maintainer

@jmencianaranjo-ionos
Comment options

@ronf
Comment options

ronf Mar 3, 2025
Maintainer

Comment options

You must be logged in to vote
1 reply
@ronf
Comment options

ronf Mar 4, 2025
Maintainer

Answer selected by jmencianaranjo-ionos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants