Sanic: Using a domain socket?

Created on 8 May 2017  路  9Comments  路  Source: sanic-org/sanic

I'm trying to put sanic behind nginx using a domain socket. Is this possible at all?

enhancement

All 9 comments

So you need to expose sanic via a domain socket, right? I don't think that's supported but shouldn't be very hard to add.

You can utilize domain sockets through gunicorn and nginx as shown in gunicorn's documentation:

http://docs.gunicorn.org/en/stable/deploy.html

Refer to our docs for how to run a sanic application through gunicorn

Gunicorn loads the class and creates a TCP listener as well. I need to use an existing setup that relies on domain sockets alone...

Right. Am willing to test and provide reference configs, of course.

ya, i think unix socket support should be separate from wsgi compatibility.

nice, will check ASAP.

@rcarmo I'm merging that as-is for now since I've tested it to work locally. However I may add more to it to make it more user friendly so the usage could break/change.

How about use create_unix_server when host or port passed as unix:///xxx.sock?

Was this page helpful?
0 / 5 - 0 ratings