moar super network (#1010)

This commit is contained in:
Michael Quigley
2025-07-29 15:00:33 -04:00
parent 7fa4b84314
commit e79a25bf69
9 changed files with 58 additions and 30 deletions

View File

@@ -1,14 +1,15 @@
package tcpTunnel
import (
"net"
"time"
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/zrok/endpoints"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/sdk/golang/sdk"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"net"
"time"
)
type FrontendConfig struct {
@@ -16,6 +17,7 @@ type FrontendConfig struct {
IdentityName string
ShrToken string
RequestsChan chan *endpoints.Request
SuperNetwork bool
}
type Frontend struct {
@@ -42,6 +44,12 @@ func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
return nil, errors.Wrap(err, "error loading config")
}
zCfg.ConfigTypes = []string{sdk.ZrokProxyConfig}
superNetwork, _ := env.SuperNetwork()
if superNetwork {
zCfg.MaxDefaultConnections = 2
zCfg.MaxControlConnections = 1
logrus.Warnf("super networking enabled")
}
zCtx, err := ziti.NewContext(zCfg)
if err != nil {
return nil, errors.Wrap(err, "error loading ziti context")