Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPN blocks Hibernate from connecting to a local PostgreSQL database on macOS #1648

Open
1 of 2 tasks
MAYOT52 opened this issue Feb 25, 2025 · 1 comment
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@MAYOT52
Copy link

MAYOT52 commented Feb 25, 2025

Search first

  • I searched and no similar issues were found

Platform/OS

macOS

OS version

Sequoia 15.3.1

Hiddify Version

2.0.5

What Happened?

When using Hiddify VPN on macOS, Hibernate fails to connect to a PostgreSQL database running on localhost. This happens regardless of whether PostgreSQL is:
• Running natively on macOS
• Running inside a Docker container
• Running inside a local VM
Spring application will only work with remote database on another machine

Minimal Reproducible Example (MRE)

1.	Start Hiddify VPN on macOS.
2.	Run a local PostgreSQL database (e.g., with Docker: docker run -p 5432:5432 postgres).
3.	Configure a Spring Boot application with Hibernate and the following datasource URL: `spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/demo`
4.	Start the Spring Boot application.
5.	Observe the connection failure with java.net.UnknownHostException: localhost.
6.	Disconnect VPN (sometimes turn off the application), and notice that the issue is resolved.

Expected Behavior

Hibernate should be able to connect to a local PostgreSQL database (localhost or 127.0.0.1) even when Hiddify VPN is active. The VPN should not interfere with local network connections between applications running on the same machine.

Additional Context

No response

Application Config Options

{
"region": "ru",
"block-ads": false,
"execute-config-as-is": false,
"log-level": "warn",
"resolve-destination": false,
"ipv6-mode": "ipv4_only",
"remote-dns-address": "udp://1.1.1.1",
"remote-dns-domain-strategy": "",
"direct-dns-address": "1.1.1.1",
"direct-dns-domain-strategy": "",
"mixed-port": 12334,
"tproxy-port": 12335,
"local-dns-port": 16450,
"tun-implementation": "mixed",
"mtu": 9000,
"strict-route": true,
"connection-test-url": "http://connectivitycheck.gstatic.com/generate_204",
"url-test-interval": 600,
"enable-clash-api": true,
"clash-api-port": 16756,
"enable-tun": false,
"enable-tun-service": false,
"set-system-proxy": true,
"bypass-lan": false,
"allow-connection-from-lan": false,
"enable-fake-dns": false,
"enable-dns-routing": true,
"independent-dns-cache": true,
"rules": [],
"mux": {
"enable": false,
"padding": false,
"max-streams": 8,
"protocol": "h2mux"
},
"tls-tricks": {
"enable-fragment": false,
"fragment-size": "10-30",
"fragment-sleep": "2-8",
"mixed-sni-case": false,
"enable-padding": false,
"padding-size": "1-1500"
},
"warp": {
"enable": false,
"mode": "proxy_over_warp",
"clean-ip": "auto",
"clean-port": 0,
"noise": "1-3",
"noise-size": "10-30",
"noise-delay": "10-30",
"noise-mode": "m6"
},
"warp2": {
"enable": false,
"mode": "proxy_over_warp",
"clean-ip": "auto",
"clean-port": 0,
"noise": "1-3",
"noise-size": "10-30",
"noise-delay": "10-30",
"noise-mode": "m6"
}
}

Relevant log output

No response

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)
@MAYOT52 MAYOT52 added the bug Something isn't working label Feb 25, 2025
@MAYOT52
Copy link
Author

MAYOT52 commented Feb 25, 2025

It seems that Hiddify might be redirecting localhost traffic through the VPN, causing Hibernate to fail when connecting to a local PostgreSQL database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant