1 Star 0 Fork 19

Hsq / Dragonfly

forked from Gitee 极速下载 / Dragonfly 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
proxy.md 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
Starnop 提交于 2019-07-18 19:37 . docs: update docs for release 0.4.2

Use dfdaemon as an HTTP proxy

Prerequisites

You need to first install and configure supernode and dfdaemon.

Proxy Configuration

Proxy rules are configured in /etc/dragonfly/dfdaemon.yml.

# Requests that match the regular expressions will be proxied with dfget,
# otherwise they'll be proxied directly. Requests will be handled by the first
# matching rule.
proxies:
  # proxy all http image layer download requests with dfget
- regx: blobs/sha256.*
  # proxy requests directly, without dfget
- regx: no-proxy-reg
  direct: true
  # change http requests to some-registry to https, and proxy them with dfget
- regx: some-registry/
  use_https: true

# If an https request's host matches any of the hijacking rules, dfdaemon will
# decrypt the request with given key pair and proxy it with the proxy rules.
hijack_https:
  cert: df.crt
  key: df.key
  hosts:
    # match hosts by regular expressions. certificate will be validated normally
  - regx: host-1
    # ignore certificate errors
  - regx: host-2
    insecure: true
    # use the given certificate for validation
  - regx: host-3
    certs: ["server.crt"]

Usage

You can use dfdaemon like any other HTTP proxy. For example on linux and macOS, you can use the HTTP_PROXY or HTTPS_PROXY environment variables.

Get the Certificate of Your Server

openssl x509 -in <(openssl s_client -showcerts -servername xxx -connect xxx:443 -prexit 2>/dev/null)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/hsqhuang/Dragonfly.git
git@gitee.com:hsqhuang/Dragonfly.git
hsqhuang
Dragonfly
Dragonfly
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891