Receiving Websocket data in Swift
问题 I'm carrying this on from this question, since the focus has changed. I am trying to send string data from a vapor server over a websocket. The client side is where the main question is. This code successfully receives the string, which is expected to be JSON (but not absolutely guaranteed -- out of scope). switch message { case .data(let data): print("data: \(data)") case .string(let str): // let data = str.message(using: .utf8) let jsonData = Data(str.utf8) print("string: \(jsonData)") do {