Add exposed address

This commit is contained in:
Zoltan Papp
2024-07-02 11:57:17 +02:00
parent d3785dc1fa
commit 15a7b7629b
15 changed files with 154 additions and 128 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/netbirdio/netbird/relay/server/listener/ws"
)
type Config struct {
type ListenerConfig struct {
Address string
TLSConfig *tls.Config
}
@@ -25,13 +25,13 @@ type Server struct {
wSListener listener.Listener
}
func NewServer() *Server {
func NewServer(exposedAddress string, tlsSupport bool) *Server {
return &Server{
relay: NewRelay(),
relay: NewRelay(exposedAddress, tlsSupport),
}
}
func (r *Server) Listen(cfg Config) error {
func (r *Server) Listen(cfg ListenerConfig) error {
wg := sync.WaitGroup{}
wg.Add(2)