aboutsummaryrefslogtreecommitdiff
path: root/lib/websocket/server_bench_test.go
AgeCommit message (Collapse)Author
2026-01-03all: use SPDX license header formatShulhan
2024-03-05all: comply with linter recommendations #2Shulhan
HTTP request now implicitly create request with context. Any false positive related to not closing HTTP response body has been annotated with "nolint:bodyclose". In the example code, use consistent "// Output:" comment format, by prefixing with single space. Any comment on code now also prefixing with single space. An error returned without variables now use [errors.New] instead of [fmt.Errorf]. Any error returned using [fmt.Errorf] now wrapped using "%w" instead of "%s". Also, replace error checking using [errors.Is] or [errors.As], instead of using equal/not-equal operator. Any statement like "x = x OP y" now replaced with "x OP= y". Also, swap statement is simplified using "x, y = y, x". Any switch statement with single case now replaced with if-condition. Any call to defer on function or program that call [os.Exit], now replaced by calling the deferred function directly. Any if-else condition now replaced with switch statement, if possible.
2023-02-22lib/websocket: replace math/rand.Read with crypto/rand.ReadShulhan
The math/rand will be deprecated in Go 1.20.
2022-06-09lib/websocket: fix benchmarkShulhan
On BenchmarkUpgrader, newHandshake will return nil if the HTTP request header is invalid, and if we pass this to Server.handleUpgrade it will cause panic. This commit fix this by checking error on newHandshake.
2022-05-09all: reformat all codes using gofmt 1.19 (the Go tip)Shulhan
2020-08-10websocket: add HTTP endpoint to check server health statusShulhan
Requesting "GET /health" on WebSocket server will return HTTP status code 204, which can be used for service health checking.
2020-06-06all: use default linter optionsShulhan
2019-06-14all: fix nolint formatShulhan
The valid syntax to suppress linter warnings is "//nolint:<name>" with no space between comment and "nolint" and between ":". Also, we move the placement of nolint directive to the top of statements for multiple nolint in the same scope. While at it, fix and supress some linter warnings.
2018-11-30all: minimize and suppress linter warnings for global variablesShulhan
2018-11-29all: fix warnings from lintersShulhan
2018-07-06Add implementation of websocket server and client (RFC 6455)Shulhan