add optional config setting to use nats standard tcp instead of websockets
This commit is contained in:
parent
38907f6bc2
commit
92dd7c110f
4 changed files with 44 additions and 34 deletions
|
|
@ -151,7 +151,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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue