dsh-github-accelerator: Restoring DSH's web_fetch in Hosts Acceleration Environments

Preface

In DeepSeek Harness (dsh), agents fetch web content via the built-in web_fetch. If local hosts-based acceleration tools (SteamCommunity302, Watt Toolkit / Steam++, etc.) map github.com to 127.0.0.1 and route traffic through a local reverse proxy, requests to GitHub will fail without specific adaptation. The error typically looks like:

Error: URL hostname "github.com" resolves to a non-public IP address

Even if the address validation is bypassed, Node does not trust the root certificates of acceleration tools in the operating system’s certificate store by default, potentially leading to UNABLE_TO_GET_ISSUER_CERT_LOCALLY. The following introduces the community plugin dsh-github-accelerator (npm package @citisen/dsh-github-accelerator, repository caparisen/dsh-github-accelerator). It allows hosts within a whitelist to be accessed via web_fetch, while maintaining the built-in security policies of dsh for all other domains.

What is this?

dsh-github-accelerator is a bundle plugin for dsh, categorized as a networking tool, maintained by the GitHub user caparisen. It registers an additional fetch provider (default ID: http-accelerated). When a requested hostname is within the configured whitelist, it connects to the local acceleration endpoint using system resolution results and includes the operating system’s trust anchors during the TLS handshake. Requests not in the whitelist are still delegated to the built-in http provider, maintaining behavior consistent with official defaults regarding public IP validation, redirect policies, byte limits, and timeouts.

Reason for Failure (Background)

The built-in http provider resolves hostnames; if the resolution result contains a non-public unicast address, the entire request is rejected—a hosts entry of 127.0.0.1 github.com will inevitably trigger this rule. Acceleration tools typically install TLS Man-in-the-Middle certificates into the operating system’s certificate store; browsers and curl can trust these, but Node cannot verify the certificate chain unless system root certificates are explicitly loaded.

Core Functions

  1. Whitelist Routing: Disables the “must resolve to public address” check and uses the accelerated path only for whitelisted hosts; for example, http://127.0.0.1:8080/ (not in the default list) will still be rejected by the built-in provider.
  2. System Certificate Trust: Enables trustSystemCertificates: true by default for whitelisted hosts, allowing local acceleration CAs to be accepted (requires dsh host Node ≥ 24.9 to use tls.getCACertificates; older runtimes fall back to Node’s bundled roots, and insecureTLS: true can be set if necessary).
  3. Cooperation with Built-in HTTP: Non-whitelisted traffic completely follows the built-in http provider, avoiding expanding the exposure surface of the anonymous fetcher.
  4. Configurable Host List: Beyond default GitHub-related domains, it can be extended in cordis.patch.yml (e.g., domains in the acceleration tool’s hosts block like huggingface.co), but you should only add hostnames you are willing to trust their resolution results.

Environment Requirements

  • A dsh version with the web service and built-in http fetch provider (any official profile). The README states it has been verified on dsh 0.2.1-rc.2 (desktop, Electron 44 / Node 24.21).
  • Host Node ≥ 24.9 is required to reliably use the operating system’s certificate store; otherwise, consider fallback configurations like insecureTLS.

Installation and Activation

Web UI: Plugins → install, enter @citisen/dsh-github-accelerator and enable it.

Terminal (desktop profile):

dsh plugin --profile desktop add @citisen/dsh-github-accelerator

Install the same package from GitHub:

dsh plugin --profile desktop add github:caparisen/dsh-github-accelerator

If using the browser profile via CLI, change --profile desktop to --profile web. The package declares dsh.bundle; usually, no manual YAML edits are needed after enabling. If the provider does not take effect, completely exit and reopen dsh.

Uninstallation example:

dsh plugin --profile desktop remove @citisen/dsh-github-accelerator

Configuration

The default configuration already includes common GitHub hosts. You can override the bundle layer in the profile’s cordis.patch.yml, for example:

- id: web-fetch-accelerated
  name: '@citisen/dsh-github-accelerator'
  config:
    hosts:
      - github.com
      - '*.github.com'
      - '*.githubusercontent.com'
      - huggingface.co
      - '*.huggingface.co'

Common configuration options (excerpted from the README table):

Key Default Meaning
hosts GitHub-related domains Hostnames allowed to resolve to non-public addresses; supports *.example.com
trustSystemCertificates true Adds OS certificate store to TLS trust for whitelisted hosts
insecureTLS false Skips certificate validation (last resort only)
timeoutMs 30000 Timeout for a single fetch
maxResponseBytes 5000000 Maximum response body bytes
maxBodyChars 100000 Maximum characters after decoding; truncates and flags if exceeded
maxRedirects 5 Maximum number of same-origin redirects
selfTestUrl Empty Requests once via ctx.web.fetch on startup and writes to log for self-check

Verification

After setting selfTestUrl, check the host startup log. You should see the provider registration line and self-check results, for example:

[web-fetch-accelerated] registered provider "http-accelerated" for 5 host pattern(s): github.com, *.github.com, ...
[web-fetch-accelerated] self-test https://github.com/ -> HTTP 200 html 57684 chars in 812 ms

Subsequently, web_fetch for https://github.com/ should return page content, and https://api.github.com/rate_limit should return JSON.

Use Cases and Notes

Suitable for: Developers who run hosts acceleration locally for long periods and need to read GitHub (or other accelerated domains you add to the whitelist) documentation and APIs via web_fetch in dsh agent sessions.

Security: Whitelisted hosts no longer undergo public IP address validation; if a whitelisted domain is pointed to an internal service, web_fetch may access that internal network. The TLS trust scope for the whitelist is consistent with the operating system, which is wider than Node’s default root certificates. It only affects the model-side web_fetch path; git, curl, and package managers in the shell are not affected by this error and are not managed by this plugin anyway.

The plugin runs under the permissions of the current dsh process; before installation, it is recommended to review the source code and the MIT license on GitHub (current package version 0.1.0) to assess whether to include it in your workflow.

Troubleshooting Quick Guide:
* Still reports non-public IP → Check if the bundle is enabled, if web’s fetchProvider is http-accelerated, and if the host is in the hosts list.
* Certificate not trusted → Confirm the acceleration CA is installed in the OS or check Node version / insecureTLS.
* ECONNREFUSED → The acceleration tool is not running or is not intercepting that domain.

Conclusion

dsh-github-accelerator uses a separate http-accelerated provider to integrate local network realities like “hosts acceleration + system CA” into web_fetch, while leaving other fetch logic to the official http provider. Plugin directory page: https://www.skillhub.cn/plugins/caparisen/dsh-github-accelerator; Source code and full documentation: https://github.com/caparisen/dsh-github-accelerator. The DSH ecosystem emphasizes “Everything is a plugin”; SkillHub etc. are community directories and have no official affiliation with DeepSeek / High-Flyer.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye