I built a very similar one that I use every day, smux: https://github.com/gergomiklos/smux. Took only 1 hour with claude.