Without knowing about SSH reverse proxies, are you trying from another machine/the "proxy server" (?) to connect to a local/'private' hostname of 'localhost' that maps to the local/'private' 'loopback' address that resolves to (IPv4) '127.0.0.1' (or 127.x.x.x even) or (IPv6) '::1', when the loopback address 'resolves'/equates to the local machine, and possibly only if you have a "localhost" entry within your (*NIX - UNIX/Linux) '/etc/hosts' or (Windows) 'C:\Windows\System32\drivers\etc\hosts' file.
If so, you'd might need to target the proper 'hostname' that is mapped to a proper 'private' IP address (i.e. the one assigned to the NIC/network card) - if they are both on the same network, otherwise possibly a 'public' IP address - unless NAT (Network Address Translation - private IP to public IP conversion/replacement for outgoing & vice versa for incoming) is in place to handle this for you.