add: support running admin server on unix socket
This is useful when multiple instances run on the same machine, for example behind a proxy. Unix sockets for web and admin servers can then be put in the same folder for each instance. Can be helpful when writing tests as well.
This commit is contained in:
@@ -265,10 +265,14 @@ initSockets AppConfig{..} = do
|
||||
Just path -> createAndBindDomainSocket path configServerUnixSocketMode
|
||||
Nothing -> bindPortTCP configServerPort (fromString $ T.unpack configServerHost)
|
||||
|
||||
adminSock <- case configAdminServerPort of
|
||||
Just adminPort -> do
|
||||
adminSock <- bindPortTCP adminPort (fromString $ T.unpack configAdminServerHost)
|
||||
adminSock <- case configAdminServerUnixSocket of
|
||||
Just path -> do
|
||||
adminSock <- createAndBindDomainSocket path configAdminServerUnixSocketMode
|
||||
pure $ Just adminSock
|
||||
Nothing -> pure Nothing
|
||||
Nothing -> case configAdminServerPort of
|
||||
Just adminPort -> do
|
||||
adminSock <- bindPortTCP adminPort (fromString $ T.unpack configAdminServerHost)
|
||||
pure $ Just adminSock
|
||||
Nothing -> pure Nothing
|
||||
|
||||
pure (sock, adminSock)
|
||||
|
||||
Reference in New Issue
Block a user