Skip to content

fix: add pysocks dependency to support SOCKS5 proxy for pip install#7221

Open
Neko-Yukari wants to merge 3 commits intoAstrBotDevs:masterfrom
Neko-Yukari:add-pysocks-dependency
Open

fix: add pysocks dependency to support SOCKS5 proxy for pip install#7221
Neko-Yukari wants to merge 3 commits intoAstrBotDevs:masterfrom
Neko-Yukari:add-pysocks-dependency

Conversation

@Neko-Yukari
Copy link
Copy Markdown

Summary

Add pysocks as a dependency to enable pip install functionality when using SOCKS5 proxy configuration.

Problem

When AstrBot is configured to use a SOCKS5 proxy (via http_proxy: "socks5://..." in config), pip package installation fails because Python's urllib does not natively support SOCKS5 protocol. The pysocks library patches urllib to enable SOCKS5 support.

Solution

Add pysocks>=1.7.1 to the dependencies in pyproject.toml.

Testing

  1. Configure AstrBot with a SOCKS5 proxy
  2. Attempt to install a plugin that requires additional dependencies
  3. Verify pip can successfully download packages through the SOCKS5 proxy

Closes #(issue number if applicable)

Copilot AI review requested due to automatic review settings March 31, 2026 04:33
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 31, 2026
@dosubot dosubot bot added the area:core The bug / feature is about astrbot's core, backend label Mar 31, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds pysocks to AstrBot’s core Python dependencies to enable pip/urllib3 SOCKS5 proxy support during plugin dependency installation when a SOCKS5 proxy is configured.

Changes:

  • Add pysocks>=1.7.1 to pyproject.toml dependencies.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the pysocks dependency to pyproject.toml to enable SOCKS5 support. The review feedback points out that the requirements.txt file is currently out of sync and should be updated to include both the new pysocks dependency and the existing python-socks dependency to ensure consistency across different installation methods.

@Neko-Yukari
Copy link
Copy Markdown
Author

回复代码审查

感谢代码审查!

关于 requirements.txt 同步问题

已通过后续提交修复:

  1. commit 4a62c9fa: fix: add python-socks and pysocks to requirements.txt for consistency

    • requirements.txt 中添加了 python-socks>=2.8.0pysocks>=1.7.1
  2. commit 08aea7b7: docs: update proxy description to include https:// support

    • 更新代理描述文档

现在 pyproject.tomlrequirements.txt 已保持一致。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants