Proxy: improve number of connections logic

Signed-off-by: Eduardo Silva <eduardo@monkey.io>