mholt/caddy-l4

Fowarding to target website via a socks5 proxy.

Aperta

#114 aperta il 6 apr 2023

 (2 commenti) (0 reazioni) (0 assegnatari)Go (118 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (1751 stelle)
Metriche merge PR
 (Merge medio 14g 19h) (7 PR mergiate in 30 g)

Descrizione

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

Guida contributor