(see https://github.com/caddyserver/caddy/issues/3556 for use case)
(t *testing.T)
| 21 | |
| 22 | // (see https://github.com/caddyserver/caddy/issues/3556 for use case) |
| 23 | func TestH2ToH2CStream(t *testing.T) { |
| 24 | tester := caddytest.NewTester(t) |
| 25 | tester.InitServer(` |
| 26 | { |
| 27 | "admin": { |
| 28 | "listen": "localhost:2999" |
| 29 | }, |
| 30 | "apps": { |
| 31 | "http": { |
| 32 | "http_port": 9080, |
| 33 | "https_port": 9443, |
| 34 | "grace_period": 1, |
| 35 | "servers": { |
| 36 | "srv0": { |
| 37 | "listen": [ |
| 38 | ":9443" |
| 39 | ], |
| 40 | "routes": [ |
| 41 | { |
| 42 | "handle": [ |
| 43 | { |
| 44 | "handler": "reverse_proxy", |
| 45 | "transport": { |
| 46 | "protocol": "http", |
| 47 | "compression": false, |
| 48 | "versions": [ |
| 49 | "h2c", |
| 50 | "2" |
| 51 | ] |
| 52 | }, |
| 53 | "upstreams": [ |
| 54 | { |
| 55 | "dial": "localhost:54321" |
| 56 | } |
| 57 | ] |
| 58 | } |
| 59 | ], |
| 60 | "match": [ |
| 61 | { |
| 62 | "path": [ |
| 63 | "/tov2ray" |
| 64 | ] |
| 65 | } |
| 66 | ] |
| 67 | } |
| 68 | ], |
| 69 | "tls_connection_policies": [ |
| 70 | { |
| 71 | "certificate_selection": { |
| 72 | "any_tag": ["cert0"] |
| 73 | }, |
| 74 | "default_sni": "a.caddy.localhost" |
| 75 | } |
| 76 | ] |
| 77 | } |
| 78 | } |
| 79 | }, |
| 80 | "tls": { |
nothing calls this directly
no test coverage detected