fix: Claude Code VPN 向け IPv4 preload の resolver を修正#16
Open
fix: Claude Code VPN 向け IPv4 preload の resolver を修正#16
Conversation
昨日の障害は Claude 側の問題であり、IPv4 preload は無関係だった。 VPN 環境での安定性のため再度有効化する。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
dns.resolve4()依存からdns.lookup(..., { family: 4 })ベースへ変更しましたqueryA EREFUSED platform.claude.comが発生して OAuth ログインできない問題を回避しますorigin/masterに preload 本体がないため、再導入コミットもあわせて含まれます変更理由
dns.resolve4()は system resolver を経由せず、VPN 提供 DNS と相性が悪い環境でAquery が拒否されていましたdns.lookup(..., { family: 4 })なら macOS / VPN の resolver を使いながら IPv4 固定を維持できます影響ファイル
.claude/bun-ipv4-preload.js.zshrcsymlink.sh手動確認
node -e 'require("node:dns").resolve4("platform.claude.com", (err) => { console.log(String(err)); process.exit(err ? 1 : 0); })'でqueryA EREFUSED platform.claude.comを確認\n-node -e 'require("node:dns").lookup("platform.claude.com", { family: 4, all: true }, (err, addrs) => { console.log(err ? String(err) : JSON.stringify(addrs)); process.exit(err ? 1 : 0); })'で IPv4 解決成功を確認\n-node --import ./.claude/bun-ipv4-preload.js -e 'import https from "node:https"; await new Promise((resolve, reject) => { const req = https.get("https://platform.claude.com", (res) => { console.log(res.statusCode); res.resume(); res.on("end", resolve); }); req.on("error", reject); });'で200を確認\n-node --import ./.claude/bun-ipv4-preload.js -e 'console.log("preload ok")'で preload の構文読み込みを確認\n