Skip to content

Close the WebSocket connection when ws-mock changes.#11

Open
pr0head wants to merge 1 commit intogetmockd:mainfrom
pr0head:feature/mock-webscoket-connections
Open

Close the WebSocket connection when ws-mock changes.#11
pr0head wants to merge 1 commit intogetmockd:mainfrom
pr0head:feature/mock-webscoket-connections

Conversation

@pr0head
Copy link
Copy Markdown

@pr0head pr0head commented Apr 5, 2026

Description

Automatically disconnect active WebSocket clients with close code 1012 (Service Restart) whenever a WebSocket mock is updated or removed. Before this change, clients kept the old connection alive after a mock config change; after this change, they receive a clean close frame and reconnect with the new configuration.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Tests (adding or updating tests)

Related Issues

Fixes #10

Checklist

  • My code follows the project's style guidelines
  • I have run go fmt and go vet
  • I have added tests covering my changes
  • All new and existing tests pass (go test ./...)
  • I have updated documentation if needed
  • I have checked for breaking changes

Testing

Unit and Integration tests. Manually by Postman.

@zach-snell
Copy link
Copy Markdown
Contributor

I'll take a look at this but may be tomorrow - thanks for the contribution.

@pr0head pr0head force-pushed the feature/mock-webscoket-connections branch from bfffbdc to e557d26 Compare April 6, 2026 10:39
@pr0head
Copy link
Copy Markdown
Author

pr0head commented Apr 6, 2026

Revert the Docker CI trigger

Fixed

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.

[FEATURE] WebSocket mock: close active connections on mock update

2 participants