Skip to content

FR: Support for HTTPS_PROXY (web proxies) #41

Description

@Enelass

Describe the Feature Request

Many organisations have web proxies in place filtering all traffic from SOE.
In the absence of support for it, GitHub Copilot CLI is unable to get a working connectivity as its traffic is going direct (and blackholed) as opposed to going via the corporate proxy which would allow the traffic.

Ideally GH CP CLI would check those HTTPS_PROXY and HTTP_PROXY environment variables and take it into account.

Activity

  1. added theissue type on Sep 26, 2025
  2. kadirtugarantibbva commented on Sep 26, 2025

    @kadirtugarantibbva

    ✚ 1 This is a must have feature. Copilot CLI is announced for copilot enterprise plan as well but enterprise customers are not able to use it rn.

  3. louis-e commented on Sep 26, 2025

    @louis-e

    Temporary workaround to force copilot through a proxy:
    sudo apt install proxychains4
    mkdir -p ~/.proxychains
    cp /etc/proxychains4.conf ~/.proxychains/proxychains.conf
    nano ~/.proxychains/proxychains.conf
    Scroll to the bottom and add your proxy (change your port):

    [ProxyList]
    http 127.0.0.1 55555
    

    Remove the line starting with socks4
    Then run copilot with the following command:
    proxychains4 copilot

    This should get rid of the "Waiting for device code... Error during sign-in: fetch failed" error.

  4. SteveSandersonMS commented on Sep 26, 2025

    @SteveSandersonMS
    Contributor

    This is very valuable feedback - thanks @Enelass and people who've upvoted. Also thanks @louis-e for the temporary workaround.

    I'm filing an internal issue (team: it's 6453). Hopefully we'll have a good answer to this soon.

  5. sumkincpp commented on Sep 26, 2025

    @sumkincpp

    On the brigh side we know that Github employees don't have to bother with proxy connections 😉

  6. added
    triagedThis issue has been added to our internal issue tracker
    on Sep 26, 2025
  7. sirishkumar commented on Sep 29, 2025

    @sirishkumar

    With solution suggested at #111 (comment) i am able to login but any subsequent commands are stuck at "Thinking"

  8. Enelass commented on Sep 30, 2025

    @Enelass
    Author

    With solution suggested at #111 (comment) i am able to login but any subsequent commands are stuck at "Thinking"

    That's right, it's stuck because copilot does not forward all the traffic the proxy.
    I have identified that after setting the following env vars, where :8888 is my Web Debugging Proxy, the requests are still not traversing the proxy:

    • export {HTTP,HTTPS,ALL}_PROXY="http://127.0.0.1:8888" # Charles Web Debugging
    • export NODE_USE_ENV_PROXY=1
    • export NODE_DEBUG=http,https,tls,net
    • export NODE_OPTIONS="--trace-warnings --trace-uncaught"

    It captures one request to api.individual.githubcopilot.com and one to https://api.githubcopilot.com/models but not the actual LLM requests...
    HTTPS 33713: https createConnection should use proxy for api.githubcopilot.com:443: null

    So I had to use Wireshark to see what's happening:

    I instructed NodeJS to export TLS keys so that I could inspect the traffic in Wireshark
    export NODE_OPTIONS="--tls-keylog=$HOME/tlskey.log”

    Image

    The requests were indeed escaping the HTTP proxy so #111 is not a viable workaround.

    Image
  9. devm33 commented on Sep 30, 2025

    @devm33
    Member

    As an update here, work is in progress to move the model calls onto the networking stack that supports Node's new built-in proxy support.

    Will keep this issue updated with the progress

  10. changed the issue type fromtoon Sep 30, 2025
  11. marked Error from /login #64 as a duplicate of this issue on Sep 30, 2025
  12. devm33 commented on Oct 2, 2025

    @devm33
    Member

    Update here, improvements were shipped in 0.0.332 that should move all calls onto the latest Node.js native fetch networking stack.

    Please update to ^0.0.332 and set: export NODE_USE_ENV_PROXY=1 along with HTTP_PROXY/HTTPS_PROXY to use https://nodejs.org/api/http.html#built-in-proxy-support

  13. borcherspm commented on Oct 2, 2025

    @borcherspm

    Adding this so others know it too.

    The nodejs built in proxy is only available in v24.5.0 and higher.

    Image

    For my work we only use LTS, for which the latest is v22.20.0. I did try moving to node v24.9.0 to try it but i'm blocked by #173

  14. devm33 commented on Oct 3, 2025

    @devm33
    Member

    Thanks for testing @borcherspm could you share more details and/or logs from the error you're hitting?

  15. seriouscorey commented on Oct 3, 2025

    @seriouscorey

    I can confirm that node v24.9.0 and copilot 0.0.333 Commit: 4cbf3da is working using:

    • export HTTP_PROXY=http://myproxy
    • export NODE_USE_ENV_PROXY=1
    • export NODE_TLS_REJECT_UNAUTHORIZED=0

    Looking into what certs are getting rejected but this was at least it successful.

  16. devm33 commented on Oct 3, 2025

    @devm33
    Member

    Thanks for testing @seriouscorey!

    On Node 24, you can try setting NODE_USE_SYSTEM_CA=1 for using local system certs https://nodejs.org/api/cli.html#node_use_system_ca1

  17. borcherspm commented on Oct 3, 2025

    @borcherspm

    upgrading to 0.0.333

  18. seriouscorey commented on Oct 3, 2025

    @seriouscorey

    NODE_USE_SYSTEM_CA=1

    This solved it for me. I was able to unset NODE_TLS_REJECT_UNAUTHORIZED and use export NODE_USE_SYSTEM_CA=1 and connect through my proxy without issue now.

  19. younesbram commented on Oct 7, 2025

    @younesbram

    worked for me with node version 24 + export NODE_USE_SYSTEM_CA=1

    cant wait for this to be supported with 22 node LTS! cheers to everyone who made this happen.

  20. devm33 commented on Oct 8, 2025

    @devm33
    Member

    Available on Node 22 in the latest release 0.0.336!

  21. agohil12 commented on Nov 4, 2025

    @agohil12

    Has anybody faced what seems to be a kerberos issue while authenticating? Our corp proxies are set at firewall level and after checking logs with the networks team, the call from copilot cli is resulting in a 407 not challenged. Networks team seem to think it's related to the CLI sending NTLM instead of Kerberos.

  22. devm33 commented on Nov 4, 2025

    @devm33
    Member

    @agohil12 I don't think the undici ProxyAgent (that the CLI is using) supports either NTLM or kerberos auth. So the 407 you're seeing would be expected. To support kerberos proxy auth could you open a new issue to track?

    As a workaround if you are able to use something like px-proxy with basic auth or unauthenticated that should be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

triagedThis issue has been added to our internal issue tracker

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions