From 18b7f24a8f719e9e6de46d1f135a9cb96ba8cfdb Mon Sep 17 00:00:00 2001 From: David Tan Date: Sat, 18 Nov 2017 02:02:54 -0500 Subject: [PATCH] Add ability to use string path for `path` instead of forcing user to manually create socket. --- sanic/server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sanic/server.py b/sanic/server.py index a475fd98..24108811 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -567,7 +567,12 @@ def serve(host, port, request_handler, error_handler, before_start=None, debug=debug, ) - server_coroutine = loop.create_server( + if isinstance(sock, str): + _create_server = loop.create_unix_server + else: + _create_server = loop.create_server + + server_coroutine = _create_server( server, host, port,