edit: Their "Router" class is a "Durable Object". There is no trace of this in their code, this is configured separately when creating the worker. A durable object is a durable JavaScript object, unrelated to K/V storage; it seems to essentially be a class whose instances act like service workers and can respond to requests using their persistent state. I guess there is special support for WebSocket endpoints in their Durable Object system so that a WebSocket endpoint can be sent to/from the Durable Object.
Their docs are really not optimal, with many different iterations of the syntax mixed together (e.g. some thing only work with the "Module syntax" but every single example is written with the "addEventListener syntax").