mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-05 12:23:03 +02:00
add tests/benchmarks for http1/http2 tcp tunnels and http1 websockets (#5471)
* add tests/benchmarks for http1/http2 tcp tunnels and http1 websockets testenv: - add new TCP upstream - add websocket functions to HTTP upstream - add https support to mock idp (default on) - add new debug flags -env.bind-address and -env.use-trace-environ to allow changing the default bind address, and enabling otel environment based trace config, respectively * linter pass --------- Co-authored-by: Denis Mishin <dmishin@pomerium.com>
This commit is contained in:
parent
d6b02441b3
commit
08623ef346
12 changed files with 1104 additions and 182 deletions
|
@ -1,6 +1,7 @@
|
|||
package testenv
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
|
@ -74,3 +75,19 @@ func (b *PolicyRoute) PPL(ppl string) Route {
|
|||
func (b *PolicyRoute) URL() values.Value[string] {
|
||||
return b.from
|
||||
}
|
||||
|
||||
type TCPRoute struct {
|
||||
PolicyRoute
|
||||
}
|
||||
|
||||
func (b *TCPRoute) From(fromURL values.Value[string]) Route {
|
||||
b.from = values.Bind(fromURL, func(urlStr string) string {
|
||||
from, _ := url.Parse(urlStr)
|
||||
from.Scheme = "tcp+https"
|
||||
from.Host = fmt.Sprintf("%s:%s", from.Hostname(), from.Port())
|
||||
return from.String()
|
||||
})
|
||||
return b
|
||||
}
|
||||
|
||||
var _ Route = (*TCPRoute)(nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue