Skip to content

Commit 54e809e

Browse files
committed
fix(wsrx): cannot open page on windows
1 parent 90f301e commit 54e809e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/GZCTF/ClientApp/src/components/InstanceEntry.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ export const InstanceEntry: FC<InstanceEntryProps> = (props) => {
147147
requestProxy()
148148
}, [originalEntry, isWsrxUsable, label, wsrxOptions.allowLan])
149149

150-
const entry = isWsrxUsable && !useOriginal ? localEntry : originalEntry
151-
const entryIsWss = isPlatformProxy && (useOriginal || !isWsrxUsable)
150+
const useLocal = isWsrxUsable && !useOriginal
151+
const entry = useLocal ? localEntry : originalEntry
152+
const entryIsWss = isPlatformProxy && !useLocal
152153

153154
const onCopyEntry = () => {
154155
clipBoard.copy(entry)
@@ -246,7 +247,11 @@ export const InstanceEntry: FC<InstanceEntryProps> = (props) => {
246247
<ActionIcon
247248
disabled={entryIsWss}
248249
component="a"
249-
href={entryIsWss ? '#' : `http://${entry}`}
250+
href={
251+
entryIsWss
252+
? '#'
253+
: `http://${useLocal && wsrxOptions.allowLan ? entry.replace('0.0.0.0', '127.0.0.1') : entry}`
254+
}
250255
target={entryIsWss ? undefined : '_blank'}
251256
rel="noreferrer"
252257
>

0 commit comments

Comments
 (0)