2024-09-13 20:40:55 +02:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
2024-09-17 03:32:17 +02:00
|
|
|
"github.com/michaelquigley/pfxlog"
|
2024-09-13 20:40:55 +02:00
|
|
|
"github.com/openziti/zrok/agent/proctree"
|
2024-11-14 21:03:41 +01:00
|
|
|
"github.com/openziti/zrok/cmd/zrok/subordinate"
|
2024-09-13 20:40:55 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type access struct {
|
2024-09-17 03:32:17 +02:00
|
|
|
frontendToken string
|
|
|
|
token string
|
2024-09-13 20:40:55 +02:00
|
|
|
bindAddress string
|
2024-11-07 19:48:41 +01:00
|
|
|
autoMode bool
|
|
|
|
autoAddress string
|
|
|
|
autoStartPort uint16
|
|
|
|
autoEndPort uint16
|
2024-09-13 20:40:55 +02:00
|
|
|
responseHeaders []string
|
|
|
|
|
2024-11-14 21:03:41 +01:00
|
|
|
process *proctree.Child
|
|
|
|
sub *subordinate.MessageHandler
|
2024-09-13 20:40:55 +02:00
|
|
|
|
2024-09-25 17:06:06 +02:00
|
|
|
agent *Agent
|
2024-09-13 20:40:55 +02:00
|
|
|
}
|
2024-09-17 03:32:17 +02:00
|
|
|
|
|
|
|
func (a *access) monitor() {
|
|
|
|
if err := proctree.WaitChild(a.process); err != nil {
|
|
|
|
pfxlog.ChannelLogger(a.token).Error(err)
|
|
|
|
}
|
2024-09-25 17:06:06 +02:00
|
|
|
a.agent.rmAccess <- a
|
2024-09-17 03:32:17 +02:00
|
|
|
}
|