failed to parse PROXY header
I run go-mmproxy with this command
sudo /root/go/bin/go-mmproxy -l 0.0.0.0:22 -4 xxx.xxx.xxx.xxx:22 -v 2
As I want to proxy an ssh connection to the xxx.xxx.xxx.xxx server.
But when i try to connect I get
{"time":"2024-01-17T01:58:54.966455461+01:00","level":"DEBUG","msg":"failed to parse PROXY header","listenerNum":0,"protocol":"tcp","listenAdr":"0.0.0.0:22","remoteAddr":"aa.aa.aa.aa:35100","localAddr":"bb.bb.bb.bb:22","error":"PROXY header missing","dropConnection":true}
I'm missing something?
same here.
i got the same error , any workaround or did i miss something here
"msg":"failed to read PROXY header","listenerNum":0,"protocol":"tcp","listenAdr":"0.0.0.0:5522","remoteAddr":"xx.xx.xx.xx:53422","localAddr":"yy.yy.yy.yy:5522","error":"EOF","dropConnection":true
@majst01 , @stargo ,can you please provide your insights on this
Did you connect to the load balancer or this proxy directly? If you bypass the load balancer, then the header won't be attached. PROXY header missing, as per this issue description, means that no header with source info was added before getting to go-mmproxy.
Could also be that send-proxy wasn't enabled on the load balancer, which tells it to add the info.
I connect directly to the Proxy
The flow needs to be:
- Load balancer or other proxy that adds the Proxy Protocol header (
send-proxyorsend-proxy-v2) -
go-mmproxy - Your back-end service that doesn't support Proxy Protocol on its own.
If you bypass step 1, go-mmproxy doesn't get the header info it needs.
To add more to colans's anwser: https://github.com/path-network/go-mmproxy/issues/29#issuecomment-2359609503
Load balancer example:
haproxy, backend:
server 127.0.0.1:12345 send-proxy
haproxy, backend:
server 127.0.0.1:12345 send-proxy-v2
nginx, in some block:
proxy_protocol on; proxy_pass 127.0.0.1:12345;
Connection flow: incoming connection to server --> Load balancer (adding proxy protocol) --> go-mmproxy --> back-end service
I have same error but with latest nginx/angie
On LB server (192.168.100.53) nginx config:
stream{
server {
listen 11153 udp;
proxy_pass 192.168.100.55:5353;
proxy_responses 1;
proxy_protocol on;
proxy_timeout 5s;
proxy_connect_timeout 3s;
}
}
on dns server (192.168.100.55) with go-mmproxy and AdGuard
/usr/local/bin/go-mmproxy -l 0.0.0.0:5353 -4 127.0.0.1:15353 -p udp -v 2
AdGuard runs on 127.0.0.1:15353
in go-mmproxy i've got this error when make dig command dig @192.168.100.53 -p11153 google.com A:
{"time":"2025-05-01T01:54:31.06979406Z","level":"DEBUG","msg":"failed to parse PROXY header","listenerNum":0,"protocol":"udp","listenAddr":"0.0.0.0:5353","error":"PROXY header missing","remoteAddr":"192.168.100.53:53232"}
On DNS server i've added route as described in readme:
ip rule add from 127.0.0.1/8 iif lo table 123
ip route add local 0.0.0.0/0 dev lo table 123
What i missed?