Categorygithub.com/FadyGamilM/go-websockets
module
0.0.0-20231006071633-26e8bbf1c9ef
Repository: https://github.com/fadygamilm/go-websockets.git
Documentation: pkg.go.dev

# README

Simple-Real-Time-Chat-App

Hub :

➜ The manager of the rooms
➜ Running on a separate go routine rather than the main routine

The websocket connection of gorillamux actually allows one concurrent writer at a time

browser actually responds to the ping messages by default, all we need to do is to handle the server-side code -> this what happend when a client connected and suddenly disconnected, the server will now by catching the "writemsg: websocket: close sent"

2023/10/06 10:11:32 [Heartbeat] | ping
2023/10/06 10:11:32 pong
2023/10/06 10:11:41 [Heartbeat] | ping
2023/10/06 10:11:41 pong
2023/10/06 10:11:50 [Heartbeat] | ping
2023/10/06 10:11:50 pong
2023/10/06 10:11:59 [Heartbeat] | ping
2023/10/06 10:11:59 pong
2023/10/06 10:12:08 [Heartbeat] | ping
2023/10/06 10:12:08 pong
2023/10/06 10:12:15 error ==> websocket: close 1000 (normal)
2023/10/06 10:12:17 [Heartbeat] | ping
2023/10/06 10:12:17 writemsg:  websocket: close sent

# Packages

No description provided by the author
No description provided by the author