Skip to content

Comments

Add WebSocket-specific ping interval configuration option#7614

Merged
neilalexander merged 1 commit intomainfrom
wq/ws-ping-interval
Dec 5, 2025
Merged

Add WebSocket-specific ping interval configuration option#7614
neilalexander merged 1 commit intomainfrom
wq/ws-ping-interval

Conversation

@wallyqs
Copy link
Member

@wallyqs wallyqs commented Dec 4, 2025

Adds support to set a custom ping interval specifically for WebSocket connections, independent from the default NATS client ping interval:

websocket {
  port: 8080
  ping_interval: "30s"
}

Signed-off-by: Waldemar Quevedo wally@nats.io

This commit adds a new PingInterval field to WebsocketOpts that allows
setting a custom ping interval specifically for WebSocket connections,
independent from the default NATS client ping interval.

```
websocket {
  port: 8080
  ping_interval: "30s"
}
```

Signed-off-by: Waldemar Quevedo <wally@nats.io>
@wallyqs wallyqs requested a review from a team as a code owner December 4, 2025 18:36
o.ReconnectErrorReports = int(v.(int64))
case "websocket", "ws":
if err := parseWebsocket(tk, o, errors); err != nil {
if err := parseWebsocket(tk, o, errors, warnings); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we got this warning populated in the parseWebsocket (wired interface, btw), but we never used it.
Looks like we need to print them in

func ProcessConfigFile(configFile string) (*Options, error) {
?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@neilalexander neilalexander merged commit 05e659c into main Dec 5, 2025
67 of 70 checks passed
@neilalexander neilalexander deleted the wq/ws-ping-interval branch December 5, 2025 10:31
neilalexander added a commit that referenced this pull request Dec 5, 2025
Includes the following:

- #7581
- #7585
- #7586
- #7565
- #7588
- #7593
- #7589
- #7594
- #7595
- #7596
- #7597
- #7598
- #7600
- #7601
- #7602
- #7604
- #7605
- #7607
- #7609
- #7610
- #7616
- #7614

Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander added a commit that referenced this pull request Dec 18, 2025
Includes the following:

- #7553
- #7555
- #7579
- #7578
- #7581
- #7585
- #7586
- #7588
- #7593
- #7594
- #7595
- #7596
- #7597
- #7598
- #7601
- #7604
- #7605
- #7610
- #7616
- #7614
- #7622
- #7619
- #7624
- #7625
- #7627
- #7636
- #7637
- #7643
- #7648
- #7634
- #7655
- #7656

Signed-off-by: Neil Twigg <neil@nats.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants