postgrest icon indicating copy to clipboard operation
postgrest copied to clipboard

fix: bind admin server to the same host

Open develop7 opened this issue 1 year ago • 1 comments

Reuse main socket address to bind admin socket there too by resolving the address main socket is bound at and binding admin socket to it explicitly.

Introduces extra dependency to iproute for HostAddress -> IP -> String conversions, following the reference in https://www.stackage.org/haddock/lts-22.21/network-3.1.4.0/src/Network.Socket.Info.html#line-415

Fixes #3508

develop7 avatar May 13 '24 16:05 develop7

Since this will use the same host, then it would log this when the same port is used, right?

postgrest: Network.Socket.bind: resource busy (Address already in use)

It solves the issue of not allowing the same ports, but I think it's better/simpler to just not execute when server-port and admin-server-port are the same, as it was mentioned in https://github.com/PostgREST/postgrest/issues/3508#issuecomment-2113162578 (perhaps that comment wasn't addressed yet in this PR?)

laurenceisla avatar May 17 '24 18:05 laurenceisla

Closing this in favor of #3559

develop7 avatar Jun 19 '24 09:06 develop7