@@ -152,7 +152,11 @@ async def __aexit__(self) -> None:
152
152
async def start (self , host : str = "127.0.0.1" , port : int = 8080 ) -> None :
153
153
await self .state_store .open ()
154
154
self .log .debug (f"Starting appservice web server on { host } :{ port } " )
155
- if self .server .startswith ("https://" ) and not self .verify_ssl :
155
+ if self .server .startswith ("unix://" ):
156
+ path = self .server .replace ('unix://' , '' )
157
+ self .server = 'http://localhost'
158
+ connector = aiohttp .UnixConnector (limit = self .connection_limit , path = path )
159
+ elif self .server .startswith ("https://" ) and not self .verify_ssl :
156
160
connector = aiohttp .TCPConnector (limit = self .connection_limit , verify_ssl = False )
157
161
else :
158
162
connector = aiohttp .TCPConnector (limit = self .connection_limit )
@@ -176,7 +180,10 @@ async def start(self, host: str = "127.0.0.1", port: int = 8080) -> None:
176
180
ssl_ctx .load_cert_chain (self .tls_cert , self .tls_key )
177
181
self .runner = web .AppRunner (self .app )
178
182
await self .runner .setup ()
179
- site = web .TCPSite (self .runner , host , port , ssl_context = ssl_ctx )
183
+ if host .startswith ("/" ):
184
+ site = web .UnixSite (self .runner , host )
185
+ else :
186
+ site = web .TCPSite (self .runner , host , port , ssl_context = ssl_ctx )
180
187
await site .start ()
181
188
182
189
async def stop (self ) -> None :
0 commit comments