I'm pretty sure "plain text" in Nim is just binary encoded utf-8. There is a special "unicode" module that defines strings as sequences of complex objects called "runes" but for the most part, when you see a string, you're looking at a "string of bytes" rather than a "text string." The server example just looked like plain text, because it used ASCII characters, which are all 1 byte each in utf-8. Just use recv and send, rather than recvLine (recvLine can lose data, anyway.)