main: add address validation and unix domain socket support

Yeah, that's fine. I'll change.