Support arbitrary network types

Fixes unix domain sockets
Merge pull request #508 from pushrax/fix-unix-sockets

Support arbitrary network types; fixes unix socket support (#508)