Skip to content

fix(net): honor proxy settings when uploading to 115/115 Open/PikPak OSS#2222

Open
Copilot wants to merge 5 commits intomainfrom
copilot/bug-115-fix-https-proxy-support
Open

fix(net): honor proxy settings when uploading to 115/115 Open/PikPak OSS#2222
Copilot wants to merge 5 commits intomainfrom
copilot/bug-115-fix-https-proxy-support

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

115, 115 Open, and PikPak uploads were creating Aliyun OSS clients without the project’s proxy-aware HTTP transport, so upload traffic bypassed HTTPS_PROXY even though other request paths already respected environment proxy settings. This change routes those OSS upload requests through the same proxy configuration used elsewhere.

  • Proxy-aware OSS client construction

    • Add a shared internal/net.NewOSSClient(...) helper that wraps oss.New(...) with the project’s HTTP client configuration.
    • Reuse existing proxy resolution behavior (http.ProxyFromEnvironment plus configured proxy override) instead of adding driver-specific proxy logic.
  • Apply to affected upload paths

    • Switch OSS client creation in:
      • drivers/115
      • drivers/115_open
      • drivers/pikpak
    • Covers both single-part and multipart OSS upload flows in the affected drivers.
  • Focused coverage

    • Add a unit test for the shared helper to verify HTTPS OSS requests resolve through HTTPS_PROXY.
func NewOSSClient(endpoint, accessKeyID, accessKeySecret string, options ...oss.ClientOption) (*oss.Client, error) {
	clientOptions := []oss.ClientOption{oss.HTTPClient(NewHttpClient())}
	clientOptions = append(clientOptions, options...)
	return oss.New(endpoint, accessKeyID, accessKeySecret, clientOptions...)
}
Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] 115/115open/pikpak驱动的上传不支持HTTPS_PROXY</issue_title>
<issue_description>### 请确认以下事项

  • 我已确认阅读并同意 AGPL-3.0 第15条
    本程序不提供任何明示或暗示的担保,使用风险由您自行承担。

  • 我已确认阅读并同意 AGPL-3.0 第16条
    无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。

  • 我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。

  • 我已确认阅读了OpenList文档

  • 我已确认没有重复的问题或讨论。

  • 我已确认是OpenList的问题,而不是其他原因(例如 网络依赖操作)。

  • 我认为此问题必须由OpenList处理,而非第三方。

  • 我已确认这个问题在最新版本中没有被修复。

  • 我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue 。

OpenList 版本(必填)

v4.1.10-aio

使用的存储驱动(必填)

115open, pikpak

问题描述(必填)

经测试,115open, pikpak驱动的上传过程不会走HTTPS_PROXY(下载过程是走的)强制直连,在PROXY面板上统计不到任何相关流量和连接

已确认是驱动实现的问题,调用oss.new()没传代理参数

https://github.com/copilot/share/822d132e-0a04-8c70-a903-ee4140246901
https://github.com/copilot/share/802d40be-0a20-88f0-9853-ec0144244111

ossClient, err := oss.New(tokenResp.Endpoint, tokenResp.AccessKeyId, tokenResp.AccessKeySecret, oss.SecurityToken(tokenResp.SecurityToken))

搜索相关代码,判断受影响的驱动:115, 115open, pikpak,测试了115open, pikpak的上传确实是不走HTTPS_PROXY

https://github.com/search?q=repo%3AOpenListTeam%2FOpenList%20oss.new&type=code

日志(必填)

配置文件内容(必填)

services:
  openlist:
    image: openlistteam/openlist:v4.1.10-aio
    container_name: openlist
    network_mode: bridge
    user: '0:0'
    ports:
      - 5244:5244
      - 5246:5246
    environment:
      - UMASK=022
      - TZ=Asia/Shanghai
      - http_proxy=http://mydomain:7890
      - https_proxy=http://mydomain:7890
      - all_proxy=http://mydomain:7890
      - no_proxy=localhost,127.0.0.1

115open驱动已开启网页代理、本机代理

Image

复现链接(可选)

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI and others added 2 commits March 13, 2026 01:55
Co-authored-by: jyxjjj <16695261+jyxjjj@users.noreply.github.com>
Co-authored-by: jyxjjj <16695261+jyxjjj@users.noreply.github.com>
Copilot AI changed the title [WIP] [BUG] Fix HTTPS proxy support for PikPak driver uploads Honor HTTPS proxy settings for 115/115 Open/PikPak OSS uploads Mar 13, 2026
Copilot AI requested a review from jyxjjj March 13, 2026 01:58
@jyxjjj jyxjjj changed the title Honor HTTPS proxy settings for 115/115 Open/PikPak OSS uploads fix(proxy|115|pikpak): honor proxy settings when uploading to 115/115 Open/PikPak OSS Mar 13, 2026
@jyxjjj jyxjjj marked this pull request as ready for review March 13, 2026 02:18
@jyxjjj jyxjjj requested a review from xrgzs March 13, 2026 02:19
@xrgzs xrgzs changed the title fix(proxy|115|pikpak): honor proxy settings when uploading to 115/115 Open/PikPak OSS fix(net): honor proxy settings when uploading to 115/115 Open/PikPak OSS Mar 13, 2026
Copy link
Member

@xrgzs xrgzs left a comment

Choose a reason for hiding this comment

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

Running tool: /opt/homebrew/bin/go test -test.fullpath=true -timeout 30s -run ^TestNewOSSClientUsesEnvironmentHTTPSProxy$ github.com/OpenListTeam/OpenList/v4/internal/net

DEBU[2026-03-13T11:08:55.8745] Download start
=== RUN   TestNewOSSClientUsesEnvironmentHTTPSProxy
--- PASS: TestNewOSSClientUsesEnvironmentHTTPSProxy (0.00s)
PASS
ok      github.com/OpenListTeam/OpenList/v4/internal/net        1.518s

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 115/115open/pikpak驱动的上传不支持HTTPS_PROXY

3 participants