You can't see from this angle, but there's two nuts on there sandwiching the top of the mason jar lid. I cur a hole in it for the socket and then tighten them against each other around the socket thread to hold the jar on.
The construction is pretty simple, which is why I like using pipe fittings. The difficult part was the wiring. As you can imagine, electricity and metal are not a great combination, so I made sure every wire splice was soldered, heat-shrinked, and taped with insulated electrical tape.