-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into otel-client
- Loading branch information
Showing
24 changed files
with
309 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
caddytest/integration/caddyfile_adapt/reverse_proxy_health_reqbody.caddyfiletest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
:8884 | ||
|
||
reverse_proxy 127.0.0.1:65535 { | ||
health_uri /health | ||
health_request_body "test body" | ||
} | ||
---------- | ||
{ | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":8884" | ||
], | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "reverse_proxy", | ||
"health_checks": { | ||
"active": { | ||
"body": "test body", | ||
"uri": "/health" | ||
} | ||
}, | ||
"upstreams": [ | ||
{ | ||
"dial": "127.0.0.1:65535" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
caddytest/integration/caddyfile_adapt/reverse_proxy_localaddr.caddyfiletest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
https://example.com { | ||
reverse_proxy http://localhost:54321 { | ||
transport http { | ||
local_address 192.168.0.1 | ||
} | ||
} | ||
} | ||
|
||
---------- | ||
{ | ||
"apps": { | ||
"http": { | ||
"servers": { | ||
"srv0": { | ||
"listen": [ | ||
":443" | ||
], | ||
"routes": [ | ||
{ | ||
"match": [ | ||
{ | ||
"host": [ | ||
"example.com" | ||
] | ||
} | ||
], | ||
"handle": [ | ||
{ | ||
"handler": "subroute", | ||
"routes": [ | ||
{ | ||
"handle": [ | ||
{ | ||
"handler": "reverse_proxy", | ||
"transport": { | ||
"local_address": "192.168.0.1", | ||
"protocol": "http" | ||
}, | ||
"upstreams": [ | ||
{ | ||
"dial": "localhost:54321" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"terminal": true | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package caddycmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type rootCommandFactory struct { | ||
constructor func() *cobra.Command | ||
options []func(*cobra.Command) | ||
} | ||
|
||
func newRootCommandFactory(fn func() *cobra.Command) *rootCommandFactory { | ||
return &rootCommandFactory{ | ||
constructor: fn, | ||
} | ||
} | ||
|
||
func (f *rootCommandFactory) Use(fn func(cmd *cobra.Command)) { | ||
f.options = append(f.options, fn) | ||
} | ||
|
||
func (f *rootCommandFactory) Build() *cobra.Command { | ||
o := f.constructor() | ||
for _, v := range f.options { | ||
v(o) | ||
} | ||
return o | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.