Current WebSocketTransport.close() only returns code number '100' regardless of any specific reason of websocket closed.
Why not to support correct status code in order for the module relying on go-protoo package to properly handle error situation happened to websocket?
RFC6455 specifies several websocket close codes. I think it would be better to comply with it for better project.
I checked 'gollira/websocket' also supports/return websocket close code as specified in RFC6455.
It could only handle peer-leave in case of the status code higher than 1000, which means it considers abnormal websocket close situation except normal closure.
Thus, the code snippet from that project below is currently dead code for now.
It would be enough to keep status code with description delivered by gollira/websocket and send it through transport.onClose channel.
Current WebSocketTransport.close() only returns code number '100' regardless of any specific reason of websocket closed.
Why not to support correct status code in order for the module relying on go-protoo package to properly handle error situation happened to websocket?
RFC6455 specifies several websocket close codes. I think it would be better to comply with it for better project. I checked 'gollira/websocket' also supports/return websocket close code as specified in RFC6455.
In addition, one of project that relies on go-protoo has a defect due to the lack of status code for websocket close as below
It would be enough to keep status code with description delivered by gollira/websocket and send it through transport.onClose channel.
Please review my feedback.
` handleClose := func(code int, err string) { if allowClientDisconnect { log.Infof("signal.in handleClose.AllowDisconnected => peer (%s)", peer.ID()) return }
`
Is there any reason to use code number '100' returning in close()?