brubeck icon indicating copy to clipboard operation
brubeck copied to clipboard

http daemon bind doesn't respect socket address from config file

Open cahlbin opened this issue 8 years ago • 0 comments

config.json:

{
  ...
  "http" : "127.0.0.1:8080",
  ...
}

Expected: brubeck should bind only to the loopback interface / 127.0.0.1.

Actual: brubeck binds it's http listener on all interfaces (see *:8080 below)

[localhost]# ss -tulpn | grep brubeck
udp    UNCONN     0      0      127.0.0.1:8125     *:*     users:(("brubeck",pid=27614,fd=6))
tcp    LISTEN     0      32     *:8080             *:*     users:(("brubeck",pid=27614,fd=7))

Possible fix is to parse out the address from the "http" bind string and pass along as MHD_OPTION_SOCK_ADDR in brubeck_http_endpoint_init.

See https://github.com/github/brubeck/blob/c3b66aa89e224598c0ff9312e88619752c7988d8/src/http.c#L258

cahlbin avatar Aug 24 '17 10:08 cahlbin