MCPcopy
hub / github.com/caddyserver/caddy / TestH2ToH2CStream

Function TestH2ToH2CStream

caddytest/integration/stream_test.go:23–151  ·  view source on GitHub ↗

(see https://github.com/caddyserver/caddy/issues/3556 for use case)

(t *testing.T)

Source from the content-addressed store, hash-verified

21
22// (see https://github.com/caddyserver/caddy/issues/3556 for use case)
23func 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": {

Callers

nothing calls this directly

Calls 6

InitServerMethod · 0.95
AssertResponseCodeMethod · 0.95
NewTesterFunction · 0.92
SetMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected