fix(connections): show destination IP as host for raw-IP targets (#7483)

* fix(connections): show destination IP as host for raw-IP targets

When metadata.host is empty (a raw-IP CONNECT with no domain), the
connection "Host" column fell back to remoteDestination (the outbounds
relay/exit address) joined with the destination port, which misleadingly
showed the relay as the connections destination.

Fall back to metadata.destinationIP instead, in both the list column
(getConnectionHost) and the detail panel.

Closes #6669

* fix(connections): preserve fallback for empty destination IP

---------

Co-authored-by: wonfen <eiwonfen@gmail.com>
This commit is contained in:
ysakura99
2026-07-14 14:42:07 +08:00
committed by GitHub
co-authored by wonfen
parent 7ca20fc4ed
commit f1e0622813
3 changed files with 7 additions and 6 deletions
@@ -73,9 +73,9 @@ const InnerConnectionDetail = ({ data, closed, onClose }: InnerProps) => {
const theme = useTheme()
const chains = [...data.chains].reverse().join(' / ')
const rule = rulePayload ? `${data.rule}(${rulePayload})` : data.rule
const host = metadata.host
? `${metadata.host}:${metadata.destinationPort}`
: `${metadata.remoteDestination}:${metadata.destinationPort}`
const hostAddress =
metadata.host || metadata.destinationIP || metadata.remoteDestination
const host = `${hostAddress}:${metadata.destinationPort}`
const Destination = metadata.destinationIP
? metadata.destinationIP
: metadata.remoteDestination
@@ -57,9 +57,9 @@ export const getConnectionDestination = (connection: IConnectionsItem) => {
export const getConnectionHost = (connection: IConnectionsItem) => {
const { metadata } = connection
return metadata.host
? `${metadata.host}:${metadata.destinationPort}`
: `${metadata.remoteDestination}:${metadata.destinationPort}`
const host =
metadata.host || metadata.destinationIP || metadata.remoteDestination
return `${host}:${metadata.destinationPort}`
}
export const getConnectionProcess = (connection: IConnectionsItem) => {