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:
Joe Kralicky 2025-03-19 18:42:19 -04:00 committed by GitHub
parent d6b02441b3
commit 08623ef346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 1104 additions and 182 deletions

View file

@ -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)