karlseguin / websocket.zig

A websocket implementation for zig
MIT License
283 stars 25 forks source link

Closing connection with reason and custom code #39

Closed scoreboardxdev closed 1 month ago

scoreboardxdev commented 1 month ago

Hi, is there any way to close a WebSocket connection with a reason and a custom code? I have only seen the writeCloseWithCode function. Functions like writeCloseWithReason and writeCloseWithCodeAndReason(u16, []u8) would be very useful, at least for my case.

By the way, thank you for creating and maintaining this library. You are doing an excellent job!

karlseguin commented 1 month ago

added a writeCloseWithReason which takes both the code and a short (<= 123) reason.