socketio/socket.io-client ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Socket.IO client library that lets an app connect to a realtime server, send messages, and listen for updates in both the browser and Node.js.

I want it to feel simple to use, with a clean way to create a connection, handle connect and disconnect events, send custom events, and receive responses without a lot of setup. It should work well for common realtime use cases like chat, live notifications, or syncing data.

Please make the code easy to understand, add a basic example showing how someone would connect and use it, and include enough tests or checks so I can trust it works. If you need current docs or best practices, look them up online first.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab