Merge remote-tracking branch 'upstream/develop' into BigRefactor

This commit is contained in:
redanthrax 2022-07-05 09:53:16 -07:00
commit be0ea6b544
4 changed files with 68 additions and 36 deletions

View file

@ -118,7 +118,13 @@ func New(logger *logrus.Logger, version string) *Agent {
natsProxyPort = "443"
}
natsServer := fmt.Sprintf("wss://%s:%s", ac.APIURL, natsProxyPort)
// check if using nats standard tcp, otherwise use nats websockets by default
var natsServer string
if ac.NatsStandardPort != "" {
natsServer = fmt.Sprintf("tls://%s:%s", ac.APIURL, ac.NatsStandardPort)
} else {
natsServer = fmt.Sprintf("wss://%s:%s", ac.APIURL, natsProxyPort)
}
return &Agent{
Hostname: info.Hostname,