diff --git a/robot/web/options/options.go b/robot/web/options/options.go index 891871d13d4..881a909ce04 100644 --- a/robot/web/options/options.go +++ b/robot/web/options/options.go @@ -67,6 +67,8 @@ type Options struct { WebRTCOnPeerAdded func(pc *webrtc.PeerConnection) WebRTCOnPeerRemoved func(pc *webrtc.PeerConnection) + + DisableMulticastDNS bool } // New returns a default set of options which will have the diff --git a/robot/web/web.go b/robot/web/web.go index e1b03af9181..4cce690fd2a 100644 --- a/robot/web/web.go +++ b/robot/web/web.go @@ -927,6 +927,10 @@ func (svc *webService) initRPCOptions(listenerTCPAddr *net.TCPAddr, options webo OnPeerRemoved: options.WebRTCOnPeerRemoved, }), } + if options.DisableMulticastDNS { + rpcOpts = append(rpcOpts, rpc.WithDisableMulticastDNS()) + } + var unaryInterceptors []googlegrpc.UnaryServerInterceptor unaryInterceptors = append(unaryInterceptors, ensureTimeoutUnaryInterceptor) diff --git a/web/server/entrypoint.go b/web/server/entrypoint.go index 5603d6a16e9..dd023d83fde 100644 --- a/web/server/entrypoint.go +++ b/web/server/entrypoint.go @@ -54,6 +54,7 @@ type Arguments struct { RevealSensitiveConfigDiffs bool `flag:"reveal-sensitive-config-diffs,usage=show config diffs"` UntrustedEnv bool `flag:"untrusted-env,usage=disable processes and shell from running in a untrusted environment"` OutputTelemetry bool `flag:"output-telemetry,usage=print out telemetry data (metrics and spans)"` + DisableMulticastDNS bool `flag:"disable-mdns,usage=disable server discovery through multicast DNS"` } type robotServer struct { @@ -198,6 +199,7 @@ func (s *robotServer) createWebOptions(cfg *config.Config) (weboptions.Options, options.SharedDir = s.args.SharedDir options.Debug = s.args.Debug || cfg.Debug options.WebRTC = s.args.WebRTC + options.DisableMulticastDNS = s.args.DisableMulticastDNS if cfg.Cloud != nil && s.args.AllowInsecureCreds { options.SignalingDialOpts = append(options.SignalingDialOpts, rpc.WithAllowInsecureWithCredentialsDowngrade()) }