ワンクリックで
Fix WSL git proxy connection errors (Failed to connect to 127.0.0.1 port 7890)
npx skills add https://github.com/aresbit/MateBot --skill wsl-proxy-fixこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストール
Fix WSL git proxy connection errors (Failed to connect to 127.0.0.1 port 7890)
npx skills add https://github.com/aresbit/MateBot --skill wsl-proxy-fixこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストール
OpenHarmony (鸿蒙) 服务层/框架层代码仓库架构与命名规范领域知识。 适用于识别、导航、分析和创建符合 OpenHarmony 分层架构标准的代码仓库。 当用户需要以下任一场景时使用此 Skill: (1) 分析 OpenHarmony 服务层或框架层代码仓库的目录结构与命名约定, (2) 判断一个仓库是否符合 OpenHarmony foundation 分层架构规范(subsystem/component 路径模式), (3) 理解 bundle.json 组件描述符与 GN 构建系统的路径映射关系, (4) 在 OpenHarmony 项目内新增组件、服务或接口时遵循正确的命名格式, (5) 理解 frameworks/ vs services/ vs interfaces/ vs common/ 的分层职责边界。
Convert a macOS Electron app (from .dmg) into a runnable Linux Electron app. Use when the user needs to port a macOS-only Electron desktop application to Linux, build a .deb/.rpm package from a macOS DMG, patch app.asar for Linux window behavior, or fix startup crashes after such conversion (e.g., missing chunks, t.join errors, transparent background flickering, deb dependency issues).
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Reverse engineer and deobfuscate bundled JavaScript/Electron applications. Extracts DMG/AppImage/pkg archives, unpacks app.asar, deobfuscates webpack/Vite/browserify bundles with scope-aware Babel-based variable renaming, and outputs readable source code. Use when the user wants to reverse engineer, deobfuscate, unminify, or analyze a bundled JS application (Electron, web app, Node.js), extract readable source from minified bundles, unpack app.asar, or understand how a third-party JS app works internally.
Up-to-date Zig programming language patterns for version 0.16.0. Use when writing, reviewing, or debugging Zig code, working with build.zig and build.zig.zon files, or using comptime metaprogramming. Critical for avoiding outdated patterns from training data - especially build system APIs (root_module instead of root_source_file), I/O APIs (buffered writer pattern), container initialization (.empty/.init), allocator selection (DebugAllocator), and removed language features (@Type, @cImport, async/await, usingnamespace).
CS 课程系统性学习 Skill。融合横纵分析法与结构化写作质检体系,用于深度学习一门计算机科学课程(含 lecture notes、syllabus、paper list),最终输出一份结构完整、有个人洞察的学习报告。 触发词包括但不限于:学习这门课、帮我梳理一下这个课程、研究一下这门 CS 课程、输出学习报告、课程分析、lecture notes 整理、帮我搞懂这门课。 适用于用户丢来一个课程主页(如 https://cs.brown.edu/courses/csci1650/)说"帮我学习一下"或"帮我写个学习报告"的场景。 不要用于简单名词解释(如"什么是 OS"),也不要用于写公众号文章。
| name | wsl-proxy-fix |
| description | Fix WSL git proxy connection errors (Failed to connect to 127.0.0.1 port 7890) |
| author | ericyangbit |
| version | 1.0.0 |
| tags | ["wsl","git","proxy","networking","troubleshooting"] |
This skill helps diagnose and fix git proxy connection errors in WSL (Windows Subsystem for Linux) environments. Common error: "Failed to connect to 127.0.0.1 port 7890 after 0 ms: Connection refused".
When using git in WSL, you may encounter proxy-related connection errors even when no proxy should be active. This happens because:
# Make the script executable
chmod +x tools/wsl-proxy-fix.sh
# Diagnose the problem
./tools/wsl-proxy-fix.sh --diagnose
# Auto-fix all issues
./tools/wsl-proxy-fix.sh --auto
# Clean proxy configurations
./tools/wsl-proxy-fix.sh --clean
# Switch to SSH protocol
./tools/wsl-proxy-fix.sh --ssh
# Test GitHub connection
./tools/wsl-proxy-fix.sh --test
If you prefer manual fixes:
# Clear git proxy configurations
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --local --unset http.proxy
git config --local --unset https.proxy
# Clear environment variables
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy ALL_PROXY
# Switch from HTTPS to SSH protocol
git remote set-url origin git@github.com:user/repo.git
# Test connection without proxy
git -c http.proxy= -c https.proxy= push
This error indicates git is trying to use a proxy server at 127.0.0.1:7890, but no proxy is running there.
Solution:
# Clear all proxy configurations
./tools/wsl-proxy-fix.sh --clean
# Or manually:
git config --global --unset http.proxy
git config --global --unset https.proxy
unset http_proxy https_proxy
This error occurs when using HTTPS URLs without proper authentication.
Solution:
# Switch to SSH protocol
./tools/wsl-proxy-fix.sh --ssh
# Or manually:
git remote set-url origin git@github.com:user/repo.git
This happens when SSH keys are not properly configured.
Solution:
# Check SSH keys
ls -la ~/.ssh/
# Test SSH connection
ssh -T git@github.com
# Generate new SSH key if needed
ssh-keygen -t ed25519 -C "your_email@example.com"
Check what's causing the issue:
# 1. Check git proxy settings
git config --global http.proxy
git config --global https.proxy
git config --local http.proxy
git config --local https.proxy
# 2. Check environment variables
env | grep -i proxy
# 3. Check remote URL
git config --get remote.origin.url
# 4. Test network connectivity
curl -I https://github.com
timeout 10s git ls-remote https://github.com/git/git.git
Windows proxy settings can sometimes leak into WSL.
Fix:
# Add to ~/.bashrc or ~/.zshrc
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy ALL_PROXY
Git credential manager may not work properly in WSL.
Fix:
# Use SSH instead of HTTPS
git remote set-url origin git@github.com:user/repo.git
# Or configure credential helper
git config --global credential.helper store
WSL may have DNS issues resolving github.com.
Fix:
# Check DNS resolution
nslookup github.com
# Try using IP directly (temporary)
git config --global url."https://140.82.121.4/".insteadOf "https://github.com/"
Add these to your shell configuration (~/.bashrc or ~/.zshrc):
# Clear proxy settings on shell startup
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy ALL_PROXY 2>/dev/null
# Alias for proxy-free git
alias gitnp='git -c http.proxy= -c https.proxy='
# Function to switch git remote to SSH
git-ssh() {
local remote_url
remote_url=$(git config --get remote.origin.url 2>/dev/null)
if [[ -z "$remote_url" ]]; then
echo "Error: No remote origin configured"
return 1
fi
if [[ "$remote_url" == https://github.com/* ]]; then
local repo_path="${remote_url#https://github.com/}"
repo_path="${repo_path%.git}"
local ssh_url="git@github.com:${repo_path}.git"
git remote set-url origin "$ssh_url"
echo "Switched to SSH: $ssh_url"
elif [[ "$remote_url" == https://gitlab.com/* ]]; then
local repo_path="${remote_url#https://gitlab.com/}"
repo_path="${repo_path%.git}"
local ssh_url="git@gitlab.com:${repo_path}.git"
git remote set-url origin "$ssh_url"
echo "Switched to SSH: $ssh_url"
else
echo "Cannot convert URL: $remote_url"
echo "Manual command: git remote set-url origin git@host:user/repo.git"
fi
}
The tools/wsl-proxy-fix.sh script provides a comprehensive solution:
#!/bin/bash
# WSL Git Proxy Fix Script
# Features:
# 1. Diagnose proxy configurations
# 2. Clean proxy settings
# 3. Switch to SSH protocol
# 4. Test network connectivity
# 5. Auto-fix all issues
Available options:
--diagnose: Show all proxy-related configurations--clean: Remove proxy settings from git and environment--ssh: Convert HTTPS remote URLs to SSH--test: Test GitHub connectivity--auto: Run all fixes automaticallyTo use this skill with Claude Code:
Example Claude interaction:
User: "git push fails with proxy error"
Claude: "Run: ./tools/wsl-proxy-fix.sh --diagnose"
Claude: "Then run: ./tools/wsl-proxy-fix.sh --auto"
Check script permissions:
chmod +x tools/wsl-proxy-fix.sh
Run with bash explicitly:
bash tools/wsl-proxy-fix.sh --diagnose
Check git version:
git --version
Check WSL version:
wsl --version
Check SSH agent:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
Verify GitHub SSH access:
ssh -T git@github.com
Add SSH key to GitHub:
cat ~/.ssh/id_ed25519.pub
# Copy and add to GitHub SSH keys
This skill is provided as-is under MIT License. Use at your own risk.
For issues with this skill: