Can starlette route to a unix domain socket? #2150
-
I have an existing GRPC server (built on grpclib), and I'd like to add a couple of traditional HTTP endpoints to the same service port, so I'm looking for a python webserver that can both serve it's own HTTP requests and also route to my GRPC server. Since GRPC is HTTP/2, the server needs to be able to support HTTP/2 as well. Grpclib's Server can bind to a UNIX Domain Socket instead of a host port. Does Starlette provide a way to route requests to a unix domain socket instead of an Endpoint instance? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Starlette is a web framework, not a server. Thus, it cannot be bound to Unix or TCP socket. You should use a dedicated server (like uvicorn for HTTP). For example, such a server can bind to the Unix socket and then route requests to Starlette. |
Beta Was this translation helpful? Give feedback.
Starlette is a web framework, not a server. Thus, it cannot be bound to Unix or TCP socket. You should use a dedicated server (like uvicorn for HTTP). For example, such a server can bind to the Unix socket and then route requests to Starlette.