main: add address validation and unix domain socket support

While I would personally use an if statement, either approach is clearly valid.