mirror of
https://github.com/openziti/ziti.git
synced 2026-10-12 07:18:36 +00:00
26 lines
776 B
Go
26 lines
776 B
Go
package tests
|
|
|
|
import (
|
|
"github.com/openziti/channel/v2"
|
|
"github.com/openziti/fabric/controller"
|
|
)
|
|
|
|
func (ctx *TestContext) NewControlChannelListener() channel.UnderlayListener {
|
|
config, err := controller.LoadConfig(ControllerConfFile)
|
|
ctx.Req.NoError(err)
|
|
|
|
versionHeader, err := VersionProviderTest{}.EncoderDecoder().Encode(VersionProviderTest{}.AsVersionInfo())
|
|
ctx.Req.NoError(err)
|
|
headers := map[int32][]byte{
|
|
channel.HelloVersionHeader: versionHeader,
|
|
}
|
|
|
|
ctrlChannelListenerConfig := channel.ListenerConfig{
|
|
ConnectOptions: config.Ctrl.Options.ConnectOptions,
|
|
Headers: headers,
|
|
}
|
|
ctrlListener := channel.NewClassicListener(config.Id, config.Ctrl.Listener, ctrlChannelListenerConfig)
|
|
ctx.Req.NoError(ctrlListener.Listen())
|
|
return ctrlListener
|
|
}
|