zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.43k stars 64 forks source link

Proxy support #285

Open m8dotpie opened 1 month ago

m8dotpie commented 1 month ago

Can't find in documentation the parameters regarding the traffic forwarding through the specified proxy server. Is it possible in current implementation?

biozz commented 1 month ago

It re-uses the variable from copilot.vim.

https://github.com/zbirenbaum/copilot.lua/blob/f7612f5af4a7d7615babf43ab1e67a2d790c13a6/lua/copilot/util.lua#L227

Here is an example config:

{
    "zbirenbaum/copilot.lua",
    cmd = "Copilot",
    event = "InsertEnter",
    config = function()
        vim.g.copilot_proxy = "http://127.0.0.1:3128"
        require("copilot").setup({})
    end,
},

Note: you have to put protocol, i.e. http into the variable. It will not work if you put 127.0.0.1:3128.