olahol / melody

:notes: Minimalist websocket framework for Go
BSD 2-Clause "Simplified" License
3.75k stars 366 forks source link

Add control message support #24

Closed robbiet480 closed 7 years ago

robbiet480 commented 7 years ago

This PR adds support for sending control messages to Sessions. Previously, Melody's Close function would only close the connection without informing the websocket first. Now there is (optional) support for informing before close. This also includes the ability to be informed when the client is closing the connection and specifically with what code and error string. Finally, I ran Golint on everything and fixed where issues were found. It passes go vet without problems.

olahol commented 7 years ago

Thank you @robbiet480, nice work, also thank you for the styling fixes.