mholt/caddy-l4

Fowarding to target website via a socks5 proxy.

オープン

#114 opened on 2023/04/06

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Go (118 件のフォーク)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (1,753 個のスター)
PR merge metrics
 (平均マージ 14d 19h) (30d で 7 merged PRs)

説明

I found this extension module through google https://caddy.community/t/fowarding-to-target-website-via-a-socks5-proxy/12349

I have the same requirement as the source, when I visit http://abc.com, it can send me through a specific socks5 proxy (like socks5://127.0.0.1:40000 of cf warp or shadowsocks/v2ray) Redirect to the target website, such as: https://xxx.com

I try to learn the configuration of this module, but I have no clue at all. The display in the readme is relatively simple. I can't understand what configuration I need to do. Can you help me?

My original configuration looks like this:

{
    "apps": {
        "http": {
            "servers": {
                "srv0": {
                    "listen": [":443"],
                    "routes": [{
                        "match": [{ "host": ["abc.com"] }],
                        "handle": [{
                            "handler": "subroute",
                            "routes": [{
                                "handle": [{
                                    "handler": "reverse_proxy",
                                    "headers": { "request": { "set": { "Host": ["{http.reverse_proxy.upstream.hostport}"] } } },
                                    "upstreams": [{ "dial": "xxx.com:80" }]
                                }]
                            }]
                        }],
                        "terminal": true
                    }]
                }
            }
        }
    }
}

コントリビューターガイド