Error when using 'localhost' to connect in Windows

Windows can't use UNIXSocket, please fix, how to detect windows env?