Add data refresh assets and local access scripts
This commit is contained in:
@@ -8,23 +8,61 @@ WINDOWS_IPS="$(
|
||||
2>/dev/null | tr -d '\r'
|
||||
)"
|
||||
|
||||
PORT_REPORT="$(ss -ltnH 2>/dev/null | awk '
|
||||
{
|
||||
local_addr=$4
|
||||
n=split(local_addr, parts, ":")
|
||||
if (n < 2) next
|
||||
port=parts[n]
|
||||
host=substr(local_addr, 1, length(local_addr) - length(port) - 1)
|
||||
gsub(/^\[/, "", host)
|
||||
gsub(/\]$/, "", host)
|
||||
key=port SUBSEP host
|
||||
if (!seen[key]++) {
|
||||
hosts[port] = hosts[port] ? hosts[port] "," host : host
|
||||
}
|
||||
}
|
||||
END {
|
||||
for (port in hosts) {
|
||||
print port "|" hosts[port]
|
||||
}
|
||||
}
|
||||
' | sort -n)"
|
||||
|
||||
ACTIVE_PORTS="$(printf '%s\n' "$PORT_REPORT" | awk -F'|' '
|
||||
NF >= 2 {
|
||||
if ($2 !~ /(^|,)(127\.0\.0\.1|::1|localhost)(,|$)/ || $2 ~ /(^|,)(0\.0\.0\.0|\*|::)(,|$)/) {
|
||||
ports = ports ? ports "," $1 : $1
|
||||
}
|
||||
}
|
||||
END { print ports }
|
||||
')"
|
||||
|
||||
LOOPBACK_ONLY_PORTS="$(printf '%s\n' "$PORT_REPORT" | awk -F'|' '
|
||||
NF >= 2 {
|
||||
if ($2 ~ /(^|,)(127\.0\.0\.1|::1|localhost)(,|$)/ && $2 !~ /(^|,)(0\.0\.0\.0|\*|::)(,|$)/) {
|
||||
ports = ports ? ports "," $1 : $1
|
||||
}
|
||||
}
|
||||
END { print ports }
|
||||
')"
|
||||
|
||||
cat <<EOF
|
||||
WSL 앱 정보
|
||||
- WSL 내부 IP: ${WSL_IP}
|
||||
- Windows 호스트와 연결된 주소 추정값: ${WSL_HOST_IP}
|
||||
- Windows IPv4 후보: ${WINDOWS_IPS:-확인 실패}
|
||||
- 포트 배치:
|
||||
- hm-biz-process: 8000
|
||||
- my-intranet-app: 8010
|
||||
- b17301: 8020
|
||||
- 현재 내부망 공개 가능 포트: ${ACTIVE_PORTS:-없음}
|
||||
- 루프백 전용 포트: ${LOOPBACK_ONLY_PORTS:-없음}
|
||||
|
||||
중요
|
||||
- WSL2에서는 다른 PC가 WSL 내부 IP(${WSL_IP})로 직접 접속하지 못하는 경우가 많습니다.
|
||||
- 내부망 다른 PC에서는 보통 Windows 호스트 IP:8010 으로 접속해야 합니다.
|
||||
- 내부망 다른 PC에서는 Windows 호스트 IP와 각 포트로 접속해야 합니다.
|
||||
- 따라서 Windows 관리자 PowerShell에서 portproxy + 방화벽 규칙을 설정해야 합니다.
|
||||
- 루프백 전용 포트(127.0.0.1/::1)는 앱을 0.0.0.0으로 실행해야 내부망 공개가 가능합니다.
|
||||
|
||||
다음 단계
|
||||
1. WSL에서 my-intranet-app 실행: ./scripts/run_server.sh 8010
|
||||
2. Windows 관리자 PowerShell 또는 CMD에서 scripts/setup_windows_all_portproxies 실행
|
||||
3. 다른 PC 브라우저에서 http://Windows호스트IP:8010 접속
|
||||
1. WSL에서 필요한 앱 실행
|
||||
2. Windows 관리자 PowerShell 또는 CMD에서 scripts/setup_windows_all_portproxies.cmd 실행
|
||||
3. 다른 PC 브라우저에서 http://Windows호스트IP:포트 로 접속
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user