Error 1006 in Cursor means the connection dropped without a proper close frame. Something between your editor and the server cut the socket mid-stream. It shows up in two places:
- Remote SSH / WSL:
Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006), often followed byCould not fetch remote environment[1]. In WSL logs it appears assocket close event (code: 1006)[2]. - AI features (Chat, Agent, Tab completions): requests hang, then fail with
WebSocket connection to 'wss://...' failedin the Developer Tools console.
Find your case below. The causes overlap, but the fixes don’t.
Quick Fix (30 Seconds)
Disable HTTP/2. This is the first fix the Cursor team recommends for WebSocket handshake failures [1]:
- Open Settings with
Ctrl+,(Windows/Linux) orCmd+,(macOS). - Search for HTTP/2.
- Enable Disable HTTP/2.
- Restart Cursor completely.
On a remote host or WSL, also clear the stale server install so the next connection starts clean:
ssh user@your-host 'pkill -f cursor-server; rm -rf ~/.cursor-server'
If the error persists, keep reading. On its own, deleting ~/.cursor-server did not fix either case in the reports below [1][2].
Root Cause Analysis
Close code 1006 is never sent by a server. The client reports it when the TCP or TLS connection disappears without a WebSocket close handshake. In Cursor this almost always means something in the network path broke the handshake or the stream: an HTTP/2 incompatibility, a proxy or TLS-inspecting firewall, or a VPN or overlay network on either end. Tailscale running on the remote VPS is one example [1]. In WSL, a separate cause is two remote extensions fighting over the same connection. When Microsoft’s WSL extension and Cursor’s own are both installed, the extension host never starts [2].
Status: As of April 2026, the Cursor team called the Remote-SSH 1006 handshake failure a known issue being tracked internally [1]. Some cases need a client update, not a config change.
Method 1: Rule Out the Network Path (Easiest)
Before changing more config, confirm where the connection breaks.
1. Apply the HTTP/2 fix first
If you skipped the Quick Fix, do it now (Ctrl/Cmd+, → search HTTP/2 → enable Disable HTTP/2 → restart). The Cursor team says this “often fixes WebSocket handshake failures” [1].
2. Check for TLS interception
openssl s_client -connect api2.cursor.sh:443 -servername api2.cursor.sh </dev/null 2>/dev/null | grep -i "issuer"
If the issuer names your company, Zscaler, Netskope, Fortinet, or your antivirus vendor instead of a public CA, your traffic is being decrypted and re-encrypted. That’s a likely culprit.
3. Toggle the obvious suspects
- Disconnect your local VPN, then retry.
- Pause antivirus web/HTTPS scanning (Kaspersky, ESET, Avast and Bitdefender all do this).
- Switch to a phone hotspot. If Cursor works there, the problem is your network, not your install.
If any of these fix it, go to Method 3 for a permanent fix instead of leaving protection turned off.
Method 2: Reset Cache, Config, and Remote Server
For AI features: clear Cursor’s local cache
Fully quit Cursor first (check the system tray). Then remove the cache directories. Don’t delete User/, which holds your settings and keybindings.
Windows (PowerShell):
$c = "$env:APPDATA\Cursor"
Remove-Item -Recurse -Force "$c\Cache","$c\CachedData","$c\GPUCache","$c\Code Cache" -ErrorAction SilentlyContinue
macOS:
cd ~/Library/Application\ Support/Cursor
rm -rf Cache CachedData GPUCache "Code Cache"
Linux:
cd ~/.config/Cursor
rm -rf Cache CachedData GPUCache "Code Cache"
Then sign out of Cursor and back in. An expired session can surface as a dropped socket instead of a clean auth error.
For Remote SSH: rebuild the server cleanly
Cursor installs its remote server in ~/.cursor-server on the host. It’s the same location users clear when troubleshooting this error [1][2].
- Close every Cursor window connected to the host.
- Kill leftover server processes and wipe the install:
ssh user@your-host 'pkill -f cursor-server; rm -rf ~/.cursor-server'
- Check that the remote disk isn’t full. A truncated server download fails silently:
ssh user@your-host 'df -h ~ /tmp'
- Reconnect. Cursor downloads a fresh server build.
Treat this as hygiene, not a guaranteed fix. In thread [1], the user had already cleared ~/.cursor-server and ~/.vscode-server and still hit 1006 on the first handshake.
Method 3: Advanced Environment Fixes
A. Overlay networks and reverse proxies on the remote host
If your VPS runs Tailscale, Docker, or a reverse proxy like Traefik, these can interfere with the server’s local ports. The Cursor team suggested two isolation tests [1]:
# Temporarily stop Tailscale on the remote host, then reconnect from Cursor
sudo systemctl stop tailscaled
# After a failed connection attempt, see which ports the Cursor server (node) is listening on
ss -tlnp | grep node
If the connection works with Tailscale stopped, or a proxy is claiming the port the server binds to, you’ve found the conflict. Restart Tailscale afterwards with sudo systemctl start tailscaled.
B. WSL: remove the conflicting WSL extension
If you’re on WSL and logs show No Connect transport provider registered or remoteTerminalBackend already registered, you likely have both ms-vscode-remote.remote-wsl (Microsoft) and anysphere.remote-wsl (Cursor’s) installed. The Cursor team’s fix [2]:
- Close any stuck Cursor windows.
- Uninstall the Microsoft extension. Use the Uninstall & Reload prompt if Cursor shows one, or uninstall it from the CLI if the UI is locked:
cursor --uninstall-extension ms-vscode-remote.remote-wsl
- Shut down WSL and restart Cursor:
wsl --shutdown
- Confirm only Cursor’s extension remains:
cursor --list-extensions
C. Corporate proxy / TLS inspection
Ask IT to bypass TLS inspection for *.cursor.sh. That’s the real fix. Until then, point Cursor at the proxy explicitly in settings.json (Ctrl+Shift+P → Preferences: Open User Settings (JSON)). Cursor is built on VS Code and reads these standard proxy keys:
{
"http.proxy": "http://proxy.company.local:8080",
"http.proxySupport": "override",
"http.proxyStrictSSL": true
}
Install your company’s root CA into the OS trust store, not just the browser. Avoid "http.proxyStrictSSL": false except as a short-lived test, because it turns off certificate validation for every extension.
D. SSH server forbids port forwarding
The remote extension host talks to your editor through an SSH tunnel. If the server disables forwarding, check /etc/ssh/sshd_config on the host for:
AllowTcpForwarding yes
Restart sshd after changing it:
sudo systemctl restart sshd
Pro Tip: Stop Fighting the Network
If you regularly work behind restrictive networks (hotel Wi-Fi, client offices, corporate VPNs), a VPN with reliable per-app split tunneling keeps Cursor’s traffic out of a broken tunnel or inspection proxy. You won’t need to rewrite config every time you change networks.
For heavy remote development, a hosted dev environment with a stable SSH endpoint also removes most cursor-server breakage, because the network between you and the box stays the same.
Verification & Edge Cases
Confirm the fix
- Help → Toggle Developer Tools → Console. Send a Chat message. There should be no
WebSocket connection ... failedlines. - For Remote SSH, open View → Output and select the Remote-SSH channel. The extension host should start with no
status code 1006entries. - Leave an Agent task running for a couple of minutes. Long streams are where intermittent 1006 errors show up.
Still failing? Collect what the Cursor team asks for
If none of the methods work, post on the Cursor forum with [1]:
- The full Remote-SSH output log.
- Your exact version from Cursor → About Cursor (Help → About on Windows/Linux).
- For WSL, the output of
cursor --list-extensions[2].
FAQ
Q: The same server works in VS Code but not in Cursor. Is my server broken? Probably not. In thread [1], the same VPS connected fine with Microsoft’s Remote-SSH but failed with Cursor’s Anysphere Remote-SSH extension. That points to the client extension or the network path, not the host. Disable HTTP/2 and run the Method 3A tests.
Q: I get ECONNRESET or ERR_HTTP2_PROTOCOL_ERROR instead of 1006. Same fix? Mostly yes. Both mean the connection was cut mid-stream, usually by the same proxy or HTTP/2 incompatibility. Start with Disable HTTP/2, then the proxy settings in Method 3C.
Sources
- [1] Cursor Community Forum: Persistent WebSocket close 1006 with Anysphere Remote-SSH 1.0.48 — fresh install, full cleanup did not help (Thread 159020, April 2026, includes the Cursor team’s diagnosis). https://forum.cursor.com/t/persistent-websocket-close-1006-with-anysphere-remote-ssh-1-0-48-fresh-install-full-cleanup-did-not-help/159020
- [2] Cursor Community Forum: [WSL] Remote connection unstable – “Open Folder” infinite loading + extension host never starts (Thread 158616, April 2026). https://forum.cursor.com/t/wsl-remote-connection-unstable-open-folder-infinite-loading-extension-host-never-starts-noresolverfound-transport-provider/158616
- [3] Cursor Documentation (official). https://cursor.com/docs