 			
 			//Connection closed
 			ws.onClose = { ws in
-				
+				guard let u = user else {
+					return
+				}
+				print("User \(u.uuid) disconnected")
+				canvas.connections.removeValue(forKey: u.uuid)
 			}
 		}
     }

		
        //Set up websocket
		socket("canvas") { req, ws in
			
			var user: User? = nil
			

@_exported import Vapor

let canvas = Canvas()

/*
TODO:
