I have been using ws-tool in one of my desktop apps. It was the smallest implementation I could find that also supported synchronous client requests. I haven't tried it on wasm32, but I don't see any reason it wouldn't work.
edit: I also completely flubbed and forgot to consider the WebSocket implementation that already exists in browsers. (To be fair, WASM is not limited to browser environments, so the above suggestions are still relevant. Sort of.) The only library I am aware of that specifically targets both desktop and web environments is ewbsock.