1. The problem I’m having:
I am trying to setup a tcp layer4 proxy:
The request phase is expected to be like this
My hetzner load balancer that forwards 3306 → my caddy l4 load balancer → frp proxy → my actual database service
I connected the domain (mysql-database.app) on my Cloudflare already.
I want to use the SNI feature because I want to bind multiple domain names to a single port, then route it respectively to each individual targets.
When I try to make a request to the database I keep getting a funny error
I get this error either I use the ip address of the proxy directly or even the domain name too. Been on this issue for quite some time now and it’s exhausting.
Also my database is also setup with tls, mysql setup has tls enabled with it
2. Error messages and/or full log output:
I keep getting this error => Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
3. Caddy version:
Caddy version: v2.10.2
4. My Caddy file setup
{
layer4 {
mysql-database.app:3306 {
@mysql tls sni mysql-database.app
route @mysql {
proxy frp-server:3390
}
}
}
}