Duplex Stream Based on DDP

I want to switch the sharejs package to use sharedb instead of sharejs.

I played around a little and the problem is that I cannot use websockets on the same port, as this is of course already used by meteor. And I do not think that it is a good solution to use another port for the sharedb connection.

Is it possible to use ddp messages to fill a duplex stream this could I use as my input.

I did not find out how I can actually can make own ddp messages and listen to them. Is there anywhere a good documentation to start with?