diff options
author | Marcel Hellkamp <marc@gsites.de> | 2019-12-08 19:31:43 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2019-12-08 19:31:43 +0100 |
commit | 4164c3f714edff1c7595b7c10af2d7482f535a1f (patch) | |
tree | ca7b30e78438379a483253d947e3c5edfc8c6172 | |
parent | 07cce60ba1ed6aa4b4f7df47fdd1b0ec47d61fea (diff) | |
download | bottle-4164c3f714edff1c7595b7c10af2d7482f535a1f.tar.gz |
fix #1167: Allow listening to unix socket for gunicorn server adapter
-rwxr-xr-x | bottle.py | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -3448,7 +3448,11 @@ class GunicornServer(ServerAdapter): def run(self, handler): from gunicorn.app.base import Application - config = {'bind': "%s:%d" % (self.host, int(self.port))} + if self.host.startswith("unix:"): + config = {'bind': self.host} + else: + config = {'bind': "%s:%d" % (self.host, self.port)} + config.update(self.options) class GunicornApplication(Application): @@ -3714,8 +3718,11 @@ def run(app=None, if not server.quiet: _stderr("Bottle v%s server starting up (using %s)...\n" % (__version__, repr(server))) - _stderr("Listening on http://%s:%d/\n" % - (server.host, server.port)) + if server.host.startswith("unix:"): + _stderr("Listening on %s\n" % server.host) + else: + _stderr("Listening on http://%s:%d/\n" % + (server.host, server.port)) _stderr("Hit Ctrl-C to quit.\n\n") if reloader: |