Fixing the "Connection failed" Error in Cursor
If you’re using Cursor and keep seeing this error: “Connection failed. If the problem persists, please check your internet connection or VPN” You’re not alone. This issue tends to appear randomly—even when your internet is working just fine. It can interrupt your flow and make the experience frustratingly unstable. Why This Happens Cursor uses the HTTP/2 protocol to power many of its AI features, since it allows streaming responses. However, not all networks handle HTTP/2 properly. If you're on a corporate network, using a VPN, or behind a proxy like Zscaler, HTTP/2 connections might fail. As a result, Cursor may struggle to index your code or connect to its AI backend—leading to that annoying “Connection failed” message. The Fix: Disable HTTP/2 Thankfully, there’s a simple workaround. Cursor now includes a fallback to HTTP/1.1, which is slower but much more reliable on certain networks. Here’s how to enable it: Open Cursor Settings (Cmd or Ctrl + ,) Go to VS Code Settings Search for http2 Find and check the option “Disable HTTP/2” This forces Cursor to use HTTP/1.1 instead, which should fix the connection issue and restore access to AI features. ✅ Once you do this, the error should stop showing up and things will run more smoothly. References Cursor Forum: Connection failed discussion Cursor Docs: Networking Issues (HTTP/2)

If you’re using Cursor and keep seeing this error:
“Connection failed. If the problem persists, please check your internet connection or VPN”
You’re not alone. This issue tends to appear randomly—even when your internet is working just fine. It can interrupt your flow and make the experience frustratingly unstable.
Why This Happens
Cursor uses the HTTP/2 protocol to power many of its AI features, since it allows streaming responses. However, not all networks handle HTTP/2 properly. If you're on a corporate network, using a VPN, or behind a proxy like Zscaler, HTTP/2 connections might fail.
As a result, Cursor may struggle to index your code or connect to its AI backend—leading to that annoying “Connection failed” message.
The Fix: Disable HTTP/2
Thankfully, there’s a simple workaround. Cursor now includes a fallback to HTTP/1.1, which is slower but much more reliable on certain networks.
Here’s how to enable it:
- Open Cursor Settings (
Cmd
orCtrl
+,
) - Go to VS Code Settings
- Search for
http2
- Find and check the option “Disable HTTP/2”
This forces Cursor to use HTTP/1.1 instead, which should fix the connection issue and restore access to AI features.
✅ Once you do this, the error should stop showing up and things will run more smoothly.