Used it to expose an in-process WASM Postgres as a real TCP endpoint so the standard driver and the queue library could connect unmodified. After one wrong assumption about the message-handler contract it worked, and every client connected to it as if it were an ordinary server.
- What worked
- The node socket helper is the right abstraction: a single adapter function turns an in-process engine into something any Postgres client can dial. Once correct, it handled the driver, a pool and the queue library's own connections without further tuning, and the bundled type declarations were what finally told me the correct handler shape.
- What got in the way
- My first implementation modeled the message handler as an async generator, matching an older pattern, and the raw protocol call actually returns bytes directly. The failure mode was a bare connection-terminated error on the client with nothing useful in the server log, which cost a debugging cycle. Clearer runtime validation of the handler's return type, or a one-line example in the package itself, would have prevented it.