fix(client): Switch websocket library#1423
Conversation
There was a problem hiding this comment.
Pull request overview
This PR switches the WebSocket implementation from golang.org/x/net/websocket to github.com/gorilla/websocket (v1.5.3) and adds t.Parallel() to client tests for improved test performance. The new library provides better API design and enables compression by default.
- Replaced
golang.org/x/net/websocketwithgitlite.zycloud.tk/gorilla/websocketfor WebSocket probes - Refactored
QueryWebSocketto use gorilla's context-based dialer with compression enabled - Added
t.Parallel()to multiple test functions to enable concurrent test execution
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| go.mod | Added gorilla/websocket v1.5.3 dependency and moved golang.org/x/net to indirect dependencies |
| go.sum | Updated checksums for new and modified dependencies |
| client/client.go | Refactored QueryWebSocket to use gorilla/websocket with context-based timeout handling, compression support, and improved message type validation |
| client/client_test.go | Added t.Parallel() to test functions and removed an extraneous blank line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I understand the changes you've made, but I don't understand the why. What made you look into changing the websocket library? Did you have any issues with the prior implementation? |
|
We have our internal WS service that we monitor. The issue with it is that it requires WebSocket compression/deflate support in the handshake to connect to it. |
|
Makes sense |
|
Thank you for the contribution! |
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/twin/gatus](https://github.com/TwiN/gatus) | minor | `v5.33.1` → `v5.34.0` | --- ### Release Notes <details> <summary>TwiN/gatus (ghcr.io/twin/gatus)</summary> ### [`v5.34.0`](https://github.com/TwiN/gatus/releases/tag/v5.34.0) [Compare Source](TwiN/gatus@v5.33.1...v5.34.0) Hello users of Gatus. I'm not a fan of mixing my personal life with open source, but I do believe in transparency, and those of you actually reading release notes are most definitely deserving of that transparency *(does anybody actually read this? if you're reading this, can you react to this release note with the least used release note emoji, "😄"? For all I know, it's always the same 10 people reading this. Or don't, really, ~~2025~~ 2026's internet has enough forced engagement as it is)*. Some of you may have noticed that in the past 6-8 weeks, reviews and merges have slowed down. This is because a few months ago, I became a father, and unlike a computing process, I can't send my child to sleep with a single command, nor can I use a debugger to find out what the problem is. I had heard that *"babies slept 16 hours a day"* before I had my own, but never could I have imagined this meant they had 16 separate 1 hour nap. I have also returned to work, because unfortunately, Gatus is just a side project for me and isn't my full time job, and while I have sufficient strength in me to handle both a full time job and being a father, I'm having a hard time maintaining my open source projects as well. I'm getting better every day, but I suspect it'll take a few months until things get back to normal. Anyways, I wish you all a wonderful 2026. Things are tough right now, but just remember you're not alone. Try to not focus on everything wrong with the world, the list is long enough to keep you unhappy. Never take life too seriously. Nobody gets out alive anyways. Happy new year, TwiN *** #### What's Changed - feat(alerting): ClickUp alerting provider by [@​TheBinaryGuy](https://github.com/TheBinaryGuy) in [#​1462](TwiN/gatus#1462) - fix(client): Switch websocket library by [@​joy4eg](https://github.com/joy4eg) in [#​1423](TwiN/gatus#1423) - fix(ui): Inconsistent time values in UI by [@​PythonGermany](https://github.com/PythonGermany) in [#​1452](TwiN/gatus#1452) - chore(ui): Remove unnecessary eslint rule disables by [@​PythonGermany](https://github.com/PythonGermany) in [#​1422](TwiN/gatus#1422) - ui: Disable hover effect if no link is set by [@​PythonGermany](https://github.com/PythonGermany) in [#​1419](TwiN/gatus#1419) - ci: Add workflow to regenerate static assets by [@​PythonGermany](https://github.com/PythonGermany) in [#​1457](TwiN/gatus#1457) - ci: Add platform input for custom action workflow by [@​PythonGermany](https://github.com/PythonGermany) in [#​1437](TwiN/gatus#1437) - docs(alerting): Remove warning for Splunk alerting provider by [@​luketainton](https://github.com/luketainton) in [#​1475](TwiN/gatus#1475) - docs: Separate web and ui config into sections by [@​PythonGermany](https://github.com/PythonGermany) in [#​1439](TwiN/gatus#1439) - docs: Add missing alert provider group override options by [@​PythonGermany](https://github.com/PythonGermany) in [#​1467](TwiN/gatus#1467) - docs: Update Telegram User ID to Chat ID in README by [@​gshpychka](https://github.com/gshpychka) in [#​1434](TwiN/gatus#1434) - docs: Update config section and add env var faq by [@​PythonGermany](https://github.com/PythonGermany) in [#​1450](TwiN/gatus#1450) #### New Contributors - [@​gshpychka](https://github.com/gshpychka) made their first contribution in [#​1434](TwiN/gatus#1434) - [@​TheBinaryGuy](https://github.com/TheBinaryGuy) made their first contribution in [#​1462](TwiN/gatus#1462) - [@​luketainton](https://github.com/luketainton) made their first contribution in [#​1475](TwiN/gatus#1475) **Full Changelog**: <TwiN/gatus@v5.33.1...v5.34.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi42OS4yIiwidXBkYXRlZEluVmVyIjoiNDIuNjkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW1hZ2UiXX0=--> Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/3036 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
t.Parallel()for client's tests