Skip to content

GunicornWebWorker: Support for unix domain sockets  #470

Closed
@devoto13

Description

At the moment GunicornWebWorker doesn't support unix domain sockets. I think it can be fixed by checking for socket type and not setting host and port for unix domain sockets. Something like:

    @asyncio.coroutine
    def _run(self):
        for sock in self.sockets:
            if isinstance(sock, gunicorn.sock.UnixSocket):
                handler = self.make_handler(self.wsgi, "", 0)
            else:
                handler = self.make_handler(self.wsgi, *sock.cfg_addr)
            srv = yield from self.loop.create_server(handler, sock=sock.sock)
            self.servers[srv] = handler

        ...

From other side I am really not sure, why does ServerHttpProtocol contains host and port. They are not used and probably not needed. So better solution would probably be to remove them completely. But it will break backwards compatibility though.

If you think either of this solutions is fine, let me know and I'll provide a pull request.


As a side question I want to ask why does aiohttp has it's own worker instead of being compatible with the WSGI spec and Gunicorn's gaiohttp worker? I found this comment, but it was never answered...

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions