dizda/fast-socks5

Task never completes, no data is sent back

Opened this issue · 3 comments

I'm trying to connect to socks5 over tor without opening a port. This is what I did:
https://github.com/acheong08/arti/blob/bb0cba1130d75ee0e58c9a42de0bad4a8ee14fa4/examples/hyper/hyper-http-hs-example/src/main.rs#L107-L160

Running and connection, I get:

SOCKS5 connection
onion service stream accepted
spawning task
task spawned

But the task never completes:

fn spawn_and_log_error<F, T, A>(fut: F) -> task::JoinHandle<()>
where
    F: Future<Output = Result<Socks5Socket<T, A>>> + Send + 'static,
    T: AsyncRead + AsyncWrite + Unpin,
    A: Authentication,
{
    eprintln!("spawning task");
    task::spawn(async move {
        eprintln!("task spawned");
        if let Err(e) = fut.await { // <---- Stuck here
            error!("{:#}", &e);
        }
        eprintln!("task finished");
    })
}

Any idea what could be causing the problem?

I'm pretty confident it's not a connection issue as the HTTP service is able to return data perfectly fine

I opened up wireshark to peek at the connections

proxychains -f ./proxychains.conf curl 1.1.1.1

No connection is made to 1.1.1.1.

2024-04-29T05:14:38.710327Z TRACE fast_socks5::server: upgrading to socks5...    
2024-04-29T05:14:38.710340Z DEBUG fast_socks5::server: skipping auth

No other logs...

The problem is the lack of manual flushing. We get stuck at reading because data is never sent. https://gitlab.torproject.org/tpo/core/arti/-/issues/1072