is it possible to setup one-hop circuit
Is it possible to create circuit for user-traffic that directly connect to exit node?
If I remove the line of circ.extend_ntor(), circ.begin_stream will return error "Received an END cell with reason TORPROTOCOL".
async fn run_ch2<R>(chanmgr: &Arc<ChanMgr<R>>, relay1: &Relay<'_>, relay2: &Relay<'_>) -> Result<()>
where
R: Runtime
{
let (ch, _provenance) = chanmgr.get_or_launch(relay1, ChannelUsage::UserTraffic).await?;
let (pending_circ, reactor) = ch.new_circ().await?;
dbgd!("new pending circ");
tokio::spawn(async {
let _ = reactor.run().await;
});
let param = CircParameters::default();
let circ = pending_circ.create_firsthop_ntor(relay1, param).await?;
dbgd!("created circ, path [{:?}]", circ.path());
// remove this line will result in "Received an END cell with reason TORPROTOCOL"
let _r = circ.extend_ntor(relay2, &CircParameters::default()).await?;
let param = StreamParameters::default();
let mut stream = circ.begin_stream("example.com", 80, Some(param)).await?;
dbgd!("created stream");
Ok(())
}