Different behavior in `arti` and `arti-client` with the same configuration regarding `localhost` with chutney

Related: onionmasq#120 (closed)

This issue is primarily related to testing; it is unlikely that this issue occurs in the real world.

Expected behavior

arti proxy and a simple arti-client program behave the same when using the same TorClientConfig; or a documentation where differences occur.

Actual behavior

I have noted a conflicting behavior when using arti proxy vs. a simple arti-client program using a TorClientConfig constructed from the same arti.toml generated by chutney. In particular, performing a stupid HTTP/1.1 request to a web server running at 127.0.0.1:80 with curl --socks5-hostname 127.0.0.1:9150 http://127.0.0.1:80 and an arti proxy started as arti -c /path/to/chutney/arti.toml works just fine, whereas the following Rust program times out when trying to receive a reply:

use anyhow::Result;
use arti_client::{StreamPrefs, TorClient, TorClientConfig};
use log::info;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tor_config::{ConfigurationSource, ConfigurationSources};

#[tokio::main]
async fn main() -> Result<()> {
    env_logger::init();

    let mut sources = ConfigurationSources::new_empty();
    sources.push_source(
        ConfigurationSource::from_path("/home/cve/chutney/net/nodes/arti.toml"),
        tor_config::sources::MustRead::MustRead,
    );

    let cfg = sources.load()?;
    let tcc = tor_config::resolve::<TorClientConfig>(cfg)?;

    let client = TorClient::create_bootstrapped(tcc).await?;
    info!("created tor client");

    let mut stream = client
        .connect_with_prefs("127.0.0.1:80", &StreamPrefs::default())
        .await?;
    info!("connected to localhost");

    stream
        .write_all("GET / HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n".as_bytes())
        .await?;
    info!("sent HTTP/1.1 request");

    // And here it stops ...

    let mut buf = vec![0_u8; 4096];
    stream.read(&mut buf).await?;
    info!("got {}", String::from_utf8_lossy(&buf));

    Ok(())
}