案例1.登录谷歌的Antigravity,显示
该网页无法正常运作
localhost 未发送任何数据。
ERR_EMPTY_RESPONSE
浏览器网址显示:http://localhost:55917/oauth-callback?state=7e1f591b-cb71-43fc-80c4-c6914f901be8&code=4/0ASc3gC0BRvhw521GeLXEM6kx6ZjFPV_KWldRNG1nPq6Zpxxoafgoi53Ur8-GV–Dv9SmZw&scope=email%20profile%20https://www.googleapis.com/auth/cloud-platform%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/cclog%20https://www.googleapis.com/auth/experimentsandconfigs%20openid&authuser=0&prompt=consent
右键菜单(最快执行)
在桌面或文件夹空白处 Shift + 右键 → 选择 “在此处打开 PowerShell 窗口” 或 “在此处打开终端窗口”
打开后执行命令
复制粘贴这个命令(右键粘贴):
$port = "55917"
$state = "7e1f591b-cb71-43fc-80c4-c6914f901be8"
$code = "4/0ASc3gC0BRvhw521GeLXEM6kx6ZjFPV_KWldRNG1nPq6Zpxxoafgoi53Ur8-GV--Dv9SmZw"
$callbackUrl = "http://127.0.0.1:$port/oauth-callback?state=$state&code=$code"
try {
$response = Invoke-WebRequest -Uri $callbackUrl -Method GET -TimeoutSec 10
Write-Host "回调成功!状态码: $($response.StatusCode)" -ForegroundColor Green
} catch {
Write-Host "连接失败: $($_.Exception.Message)" -ForegroundColor Red
}
肖兴来个人博客

