Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

AI and LLM integration · Decision guide

GitHub Copilot in VS Code times out before it reaches GitHub

Short answer

'GitHub Copilot could not connect to server' with ETIMEDOUT means Copilot's requests to GitHub got no reply. A firewall dropping the Copilot hosts, a network that needs a proxy Copilot was never given, or a proxy written as https:// causes it. Run GitHub's curl ping test, then allowlist the hosts or set http.proxy. Applies to VS Code 1.147.

  • Applies to VS Code 1.147.0, GitHub Copilot and Copilot Chat in VS Code
  • Updated
  • By Maaz Zindani, Senior Software Engineer

connect ETIMEDOUT means Copilot's request left your machine and nothing came back. Unlike a refusal, a timeout is what you get when something along the path silently discards the traffic. Three situations produce it: a firewall that drops GitHub's hosts, a network that only reaches the internet through a proxy Copilot was not given, and a proxy address that starts with https://.

GitHub provides a ping endpoint for exactly this test. Run it once directly and once through your proxy if you have one, and compare.

Find your case

  1. If the direct ping hangs, other sites load, and you have no proxyA firewall is dropping GitHub or the Copilot hosts.
  2. If the ping works through the proxy and hangs without itCopilot needs the proxy set explicitly.
  3. If a proxy is set but its address begins with https://Copilot cannot use that form.

Run the ping test

A direct call that hangs while the proxied one returns 200 means you need the proxy. Both failing, with no proxy on your network, points to a firewall.

Direct, then through the proxy

curl --verbose https://copilot-proxy.githubusercontent.com/_ping
curl --verbose -x http://YOUR-PROXY-URL:PORT -i -L https://copilot-proxy.githubusercontent.com/_ping

A firewall drops the hosts

Copilot needs GitHub's sign-in hosts as well as its own API hosts, so blocking any of them stops activation. The address in the error can show how far it got: one inside GitHub's web range means even the sign-in step failed.

Ask the network team to allow the hosts in GitHub's Copilot allowlist reference, by hostname and not by IP, because GitHub says its addresses change from time to time. The gh CLI prints the wildcard domains; the bare github.com is not covered by *.github.com and must be added separately.

List GitHub's domains for the allowlist

gh api meta -q '.domains | .website, .copilot'
# also allow: github.com

The network needs a proxy

VS Code itself can follow the system proxy. Its network documentation says extensions do not get that support yet, so for an extension such as Copilot the http.proxy setting is what counts. Without it, or a proxy environment variable, Copilot tries a direct route that the network drops.

Give VS Code the proxy

// settings.json
"http.proxy": "http://proxy.example.com:3128"

If the proxy needs a login, Copilot accepts Basic credentials inside the same URL. Reload the window afterwards.

A proxy written as https

GitHub's troubleshooting page names this as a known cause of the read ETIMEDOUT and ECONNRESET activation errors: Copilot runs its own proxy code and does not support a proxy URL that starts with https://, even when the editor or the browser handles it.

Find and replace the https form

env | grep -i _proxy
// settings.json: use the plain http:// address of the same proxy
"http.proxy": "http://proxy.example.com:8080"

Quit all VS Code windows and start it again so the new values load.

Ping again and reload the VS Code window

  • Both ping URLs answer HTTP 200.
  • Copilot activates without the ETIMEDOUT message and inline suggestions appear.
  • If the ping works but Copilot then reports certificate errors, the proxy is inspecting TLS and its root certificate must be trusted, which is a different fix.

In short

  • ETIMEDOUT means the traffic was dropped silently, not refused.
  • Allow GitHub's hosts by name; set http.proxy for the extension.
  • Use the http:// form of a proxy address.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want a second pair of eyes on it?

Send me the error and what changed before it started. I reply within 24 hours.