Skip to content

add: --dial-relay-url to connect to a peer without address lookup - #66

Open
Kiraprint wants to merge 1 commit into
rustonbsd:mainfrom
Kiraprint:dial-relay-url
Open

Kiraprint wants to merge 1 commit into
rustonbsd:mainfrom
Kiraprint:dial-relay-url

Conversation

@Kiraprint

@Kiraprint Kiraprint commented Oct 19, 2026 •

Copy link
Copy Markdown

Adds --dial-relay-url <URL>, which connects to the peer through a known relay URL instead of looking its address up.

Why

Address lookup is the only path from an endpoint id to an address. On networks that block or intercept DNS (mobile carriers, captive portals, corporate egress), lookup returns nothing and the connection fails before it starts:

Error: No addressing information available
    1: Discovery produced no results for <endpoint id>

That is #54. The relay URL alone is complete addressing, so the caller can supply it:

EndpointAddr::new(endpoint_id).with_relay_url(relay_url)

What changes

  • --dial-relay-url <URL> on the bare form, connect and exec. It is forwarded to the hidden proxy subcommand through ProxyCommand, so iroh-ssh user@endpoint --dial-relay-url … works end to end.
  • connect_pubkey takes the relay and builds the address; nothing else in the connection path moves.
  • No behaviour change without the flag: the lookup services stay configured and connect(EndpointId) is used as before.

A single URL is enough — it is the relay the server publishes to (its endpoint address contains it), not a list.

iroh-ssh user@<endpoint-id> --dial-relay-url https://<relay>/

Verification

Built and tested against a live server: a client built from this branch (iroh 1.3) connected through the supplied relay and ran a remote command, while the server was an older 0.2.12 build on iroh 0.94. The same binary still connects without the flag via normal lookup.

I did not add a docs entry — happy to extend the README/docs/ if you want it documented there.

On networks that block or intercept DNS, address lookup returns nothing and
`connect(EndpointId)` fails with:

    Error: No addressing information available
        1: Discovery produced no results for <endpoint id>

A peer's relay URL is sufficient addressing on its own, so let the caller
supply it. `--dial-relay-url <URL>` builds `EndpointAddr::new(id)
.with_relay_url(url)` and connects without lookup for that connection.

When the flag is absent nothing changes: the lookup services stay configured
and `connect(EndpointId)` behaves exactly as before.

The flag is accepted by the bare form and by `connect`, including `exec`, and
is forwarded to the hidden `proxy` subcommand through ProxyCommand, which is
how `iroh-ssh user@endpoint` reaches the peer.

Refs rustonbsd#54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants