mirror of
https://github.com/openziti/zrok.git
synced 2025-08-24 22:15:26 +02:00
moar super network (#1010)
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user