So you want to use Kotlinx sterilization in web socket in Ktor server? You can do it manually using Json.decodeFromString or you can use official web socket kotlinx serialization extension library and you just have to install and configure it in your WebSocket install then use a extension function that will do the parsing just like it would with normla http routes