dumbpipe icon indicating copy to clipboard operation
dumbpipe copied to clipboard

feat: allow specifying custom relay in dumbpipe (#60)

Open alx0x10 opened this issue 2 months ago • 5 comments

Hello I'm back!

I thought this issue would be a good first step to get familiar with Iroh, so I started implementing the possibility to define a custom relay.
As mentioned in the issue, Sendme already supports this, so I mostly adapted that code.

Before going further and adding tests, I’d like your feedback on a few points:

  • Do you think this feature makes sense here? Since Sendme already demonstrates it, maybe you prefer to keep dumbpipe shorter and focused only on the listen/connect logic?
  • I introduced the anyhow dependency like in Sendme. Would you prefer a different error-handling approach? I could just implement the From<> myself.
  • Like in Sendme, I wrapped RelayMode into RelayModeOption, which removes the Staging option. I haven’t really looked into how staging works, would you like me to explore that for this implementation?

alx0x10 avatar Sep 18 '25 17:09 alx0x10

would be nice to avoid the anyhow error, but other than that, looks reasonable

dignifiedquire avatar Sep 25 '25 08:09 dignifiedquire

Ok, thank you for the feedback, I hadn't seen this RelayUrlParseError. I made the modification and I also prefer it much more like that!

I'll look into the testing soon then and come back to you :+1:

alx0x10 avatar Sep 26 '25 07:09 alx0x10

This looks pretty good, can you fix the lint issues and move it to ready (it is still marked as draft)?

dignifiedquire avatar Oct 02 '25 09:10 dignifiedquire

Actually, as @eminence says, when running dumbpipe with the --relay disable, the code blocks at endpoint.home_relay().initialized().await; since no home relay is initialized.

I've added a condition to not run this check if we disable the use of a relay.

    if args.common.relay != RelayModeOption::Disabled {
        endpoint.home_relay().initialized().await;
    }

And I noticed that this check is not made for the connect_stdio()... I couldn't understand the reason for it.

Also, the same issue is present on Sendme. I opened an issue about it, once you validate the fix I can propagate it there.

Beside that I added some tests and info in the readme.

alx0x10 avatar Oct 03 '25 15:10 alx0x10

Hello!

I've implemented the timeout like @dignifiedquire did in sendme. And modified the help text.

Tell me if there is anything else I should change on this pr.

alx0x10 avatar Oct 16 '25 06:10 alx0x10