(excluded *wsClient)
| 175 | } |
| 176 | |
| 177 | func Serve(ctx context.Context, opts DaemonOptions) error { |
| 178 | if strings.TrimSpace(opts.Host) == "" { |
| 179 | opts.Host = "127.0.0.1" |
| 180 | } |
| 181 | if opts.EndpointPath == "" { |
| 182 | opts.EndpointPath = DefaultEndpointPath() |
| 183 | } |
| 184 | if opts.IdleCheckInterval <= 0 { |
| 185 | opts.IdleCheckInterval = 10 * time.Minute |
| 186 | } |
| 187 | if opts.IdleEmptyChecks <= 0 { |
| 188 | opts.IdleEmptyChecks = 2 |
| 189 | } |
| 190 | token, err := randomToken() |
| 191 | if err != nil { |