mholt/caddy-l4

Fowarding to target website via a socks5 proxy.

开放

#114 创建于 2023年4月6日

 (2 条评论) (0 个反应) (0 位负责人)Go (118 个派生)github user discovery
enhancementhelp wanted

仓库指标

星标
 (1,753 个星标)
PR 合并指标
 (平均合并 14天 19小时) (30 天内合并 7 个 PR)

描述

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
                    }]
                }
            }
        }
    }
}

贡献者指南