copilot.lua
copilot.lua copied to clipboard
Proxy support
Can't find in documentation the parameters regarding the traffic forwarding through the specified proxy server. Is it possible in current implementation?
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.
The solution above didn't work for me for some reason. But I found in the copilot documentation that it respects
- HTTPS_PROXY
- https_proxy
- HTTP_PROXY
- http_proxy
So I added this alias to my .zshrc and now everything works
alias nvim='HTTP_PROXY=http://127.0.0.1:2080 nvim'