diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 528220607a4f6..6f6dce60bfbd0 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -2450,6 +2450,13 @@ int main(int argc, char ** argv) { svr->set_read_timeout (params.timeout_read); svr->set_write_timeout(params.timeout_write); +#ifndef _WIN32 + if (params.hostname.substr(0, 7) == "unix://") { + svr->set_address_family(AF_UNIX); + params.hostname = params.hostname.substr(7); + } +#endif + if (!svr->bind_to_port(params.hostname, params.port)) { fprintf(stderr, "\ncouldn't bind to server socket: hostname=%s port=%d\n\n", params.hostname.c_str(), params.port); return 1;