How to make h2c to h2c proxy work

Thanks for the quick reply. I’m now using this and get a different error:

{
    debug
    admin   off
    log default {
        level debug
        output stdout
        format console
    }
    servers :7778 {
        protocols h2c
    }
}

:7778 {
    bind 127.0.0.200
    reverse_proxy * h2c://127.0.0.201:7777 {
    }
    log default {
        level debug
        output stdout
        format console
    }
}

I get in caddy:

2023/12/31 01:05:25.180 DEBUG http.handlers.reverse_proxy selected upstream {“dial”: “127.0.0.201:7777”, “total_upstreams”: 1}
2023/12/31 01:05:25.180 DEBUG http.handlers.reverse_proxy upstream roundtrip {“upstream”: “127.0.0.201:7777”, “duration”: 0.000479471, “request”: {“remote_ip”: “127.0.0.1”, “remote_port”: “36684”, “client_ip”: “127.0.0.1”, “proto”: “HTTP/2.0”, “method”: “PRI”, “host”: “”, “uri”: ““, “headers”: {“X-Forwarded-Proto”: [“http”], “X-Forwarded-Host”: [”“], “User-Agent”: [”"], “X-Forwarded-For”: [“127.0.0.1”]}}, “error”: “http2: Transport: cannot retry err [stream error: stream ID 3; PROTOCOL_ERROR; received from peer] after Request.Body was written; define Request.GetBody to avoid this error”}
2023/12/31 01:05:25.181 ERROR http.log.error.default http2: Transport: cannot retry err [stream error: stream ID 3; PROTOCOL_ERROR; received from peer] after Request.Body was written; define Request.GetBody to avoid this error {“request”: {“remote_ip”: “127.0.0.1”, “remote_port”: “36684”, “client_ip”: “127.0.0.1”, “proto”: “HTTP/2.0”, “method”: “PRI”, “host”: “”, “uri”: "
”, “headers”: {}}, “duration”: 0.000594763, “status”: 502, “err_id”: “u7td0w0b4”, “err_trace”: “reverseproxy.statusError (reverseproxy.go:1267)”}
2023/12/31 01:05:25.181 ERROR http.log.access.default handled request {“request”: {“remote_ip”: “127.0.0.1”, “remote_port”: “36684”, “client_ip”: “127.0.0.1”, “proto”: “HTTP/2.0”, “method”: “PRI”, “host”: “”, “uri”: “*”, “headers”: {}}, “bytes_read”: 0, “user_id”: “”, “duration”: 0.000594763, “size”: 0, “status”: 502, “resp_headers”: {“Server”: [“Caddy”]}}

I get in my app:

ERROR: [127.0.0.1]:55972 invalid frame (-532:Violation in HTTP messaging rule)