-
Notifications
You must be signed in to change notification settings - Fork 701
Closed
Milestone
Description
It would be great if mopidy supported AF_UNIX style sockets for mpd instead of listening on localhost. [This is especially useful for configurations where mopidy is running as a user, and may have a conflict on localhost:6600.]
Something like the following would probably work (but there's probably a better, more general method.)
diff --git a/mopidy/internal/network.py b/mopidy/internal/network.py
index cefdf8e..ae5a87b 100644
--- a/mopidy/internal/network.py
+++ b/mopidy/internal/network.py
@@ -79,9 +79,14 @@ class Server(object):
self.register_server_socket(self.server_socket.fileno())
def create_server_socket(self, host, port):
- sock = create_socket()
- sock.setblocking(False)
- sock.bind((host, port))
+ if (re.match(r'/',host):
+ sock = socket.socket(socket.AF_UNIX)
+ sock.setblocking(False)
+ sock.bind(host)
+ else:
+ sock = create_socket()
+ sock.setblocking(False)
+ sock.bind((host, port))
sock.listen(1)
return sock
jradtilbrook
Metadata
Metadata
Assignees
Labels
No labels