LinuxSuRen / LinuxSuRen/http-downloader

Provider a better way to choose the GitHub proxy

Open
#229 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
48
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Sometimes, we might meet the following errors when trying to use `gh.api.99988866.xyz`

`status code: 429`

We can record the GitHub proxy server into a config file. And mark the error when it occurs. So, it's possible to choose an available server automatically.

Since [v0.0.57](https://github.com/LinuxSuRen/http-downloader/releases/tag/v0.0.57), the config file `hd.yaml` looks like:

```yaml
fetch: true
goget: false
provider: gitee
proxy-github: gh.api.99988866.xyz
thread: 6
```

then, we can add the following items:

```yaml
proxy-github-candidates:
- server: gh.api.99988866.xyz
status: ok
lastUsed: Thu Apr 14 21:32:08 CST 2022
- server: ghproxy.com
status: error
lastUsed: Thu Apr 14 21:32:08 CST 2022
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that reads and writes hd.yaml and handles GitHub proxy requests. Review how the existing proxy-github setting is used, then determine how candidate servers should record status and last-used time. Done means the configuration supports candidates and an unavailable proxy can be skipped in favor of an available one.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.