# zed: Support IPv6 hosts in SCP-style SSH URLs \(\#62157\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a58fff1334b2ea44aaa579b15a5ddd21ccf20bd2)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a58fff1334b2ea44aaa579b15a5ddd21ccf20bd2

Requested commit: a58fff1334b2ea44aaa579b15a5ddd21ccf20bd2

Commit: a58fff1334b2ea44aaa579b15a5ddd21ccf20bd2

Tree: 5415d3fc573692de2b253fb8ec03bb36bc5c0f27

Author: Xiaobo Liu

Committer: GitHub

## Message

```
zed: Support IPv6 hosts in SCP-style SSH URLs (#62157)

# Objective

- Support opening remote paths from SCP-style SSH URLs that use
bracketed IPv6 hosts, such as `ssh://[2600::]:~/foo`.

## Solution

- Validate SSH hosts with `url::Host::parse`, which supports bracketed
IPv6 addresses while continuing to reject malformed or ambiguous hosts.
- Add test coverage for IPv6 URLs with usernames, home-relative paths,
absolute paths, and explicit ports.
- Add rejection tests for unbracketed IPv6 addresses and ambiguous
port-plus-SCP-path syntax.

## Testing

- Ran `cargo fmt --all -- --check`.
- Ran `cargo test -p zed test_parse_ssh_urls -- --nocapture`.
- Ran `cargo test -p zed test_reject_ssh_urls -- --nocapture`.
- All targeted tests passed on macOS. No additional platform-specific
testing is expected to be necessary because the change only affects URL
parsing.

Release Notes:

- Fixed opening remote paths from SCP-style SSH URLs with IPv6 hosts.

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
```

## Parents

- [32a0e813a5132ee66b2cbc47d64b4c36b409f7f3](https://git.cafe/gitcafe/zed/commit/32a0e813a5132ee66b2cbc47d64b4c36b409f7f3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a58fff1334b2ea44aaa579b15a5ddd21ccf20bd2?format=markdown)
