The magic that makes the pull up bars come together (and stay together) so easily are speed-rail fittings from Hollaender. The primary application for these components are hand railing systems, but small gym owners have be using them in custom pull up bar structures for quite some time now.
Speed-rail fittings are available in a whole host of varieties. There are different fittings to accommodate different size piping and fittings to help you make pretty much any shape you can imagine. For a full listing of the different shapes and sizes available, check out the speed-rail section on the Hollaender website.
For all the bars I’ve built, I have always used the 1.25″ fittings. I would recommend not going any smaller than this size. You can find these fittings for sale from various distributors, I personally purchased mine here. Just for reference I’ll provide links below for the most common fittings from my pull up bars.