Help with MySQL Access via Cloudflare Tunnel

I’m trying to get remote access to a MySQL database (port 3306) through a Cloudflare Tunnel. I’m running the following command in the terminal: cloudflared tunnel --url tcp://localhost:3306 However, I get an error in the terminal: malformed HTTP response "J\x00\x00\x00" I understand that MySQL is not an HTTP service, but is there a way to proxy TCP connections through Cloudflare Tunnel, or how can I correctly forward MySQL traffic (for example, using cloudflared access or other mechanisms)? The goal is to connect to MySQL (localhost:3306) from a remote machine without opening a port on the firewall or router. Is TCP proxying for MySQL supported with Cloudflare Tunnel? I couldn’t find a clear instruction for this.
No description
No description
4 Replies
SuperHelpflare
SuperHelpflare2mo ago
Feedback
Feedback has been submitted! Thank you :)
Laudian
Laudian2mo ago
Have you also installed Cloudflared on the client? Proxying mysql via the tunnel definitely works.
Laudian
Laudian2mo ago
Cloudflare Docs
Arbitrary TCP
Cloudflare Access provides a mechanism for end users to authenticate with their single sign-on (SSO) provider and connect to resources over arbitrary TCP without being on a virtual private network (VPN).
DDigitalDrifter
DDigitalDrifterOP2mo ago
2025-07-28T07:38:08Z ERR Error on Websocket listener error="failed to start forwarding server: listen tcp 192.168.56.1:...: bind: An attempt was made to access a socket in a way forbidden by its access permissions." failed to start forwarding server: listen tcp 192.168.56.1:...: bind: An attempt was made to access a socket in a way forbidden by its access permissions.?( .

Did you find this page helpful?