Determine whether WebSocket was closed by browser or server

时间:2016-11-09 08:22:52

标签: browser websocket

Is there a way to reliably determine from the onClose event of a websocket in a browser, whether it was closed "by us" (the browser) or "by them" (the server)?

I'm aware of the close codes, but in my case it's possible that the server and client send the same close code, so that's no way to discern the two cases.

0 个答案:

没有答案