share-copilot/readme/codeTipsProxy.md
luyoyu 71c4bcf440
update readme/codeTipsProxy.md.
Signed-off-by: luyoyu <8829470+chuangxxt@user.noreply.gitee.com>
2023-09-20 17:56:57 +00:00

69 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 代码提示代理说明
**-以windows为例**
## **vscode**
#### 1.修改文件:**
`%userprofile%\.vscode\extensions\github.copilot-xxxx\dist\extension.js`
**1.1.extension.js全文搜索替换下面两个接口替换为自己的url**
```js
"https://copilot-proxy.githubusercontent.com"
替换为"http://127.0.0.1" (你的url)
这个是代码提示接口
---------------------------------------------------------------
"https://copilot-telemetry.githubusercontent.com/telemetry"
替换为"http://127.0.0.1/telemetry" (你的url/telemetry)
这个应该是copilot把你代码上传拿去深度学习的,直接改成null好像也不影响使用
```
**1.2.也可以使用[脚本](https://gitee.com/chuangxxt/share-copilot/releases/download/v1.0.4/vscode%E4%B8%80%E9%94%AE%E9%85%8D%E7%BD%AE%E8%84%9A%E6%9C%AC.bat)一键修改需要将extension.js原来增加的内容删掉再配置脚本一键修改**
将127.0.0.1改为自己的Api url
GITHUB_TOKEN改为代理服务器中间件验证内容
```bash
@echo off
setlocal
:: ghu代理
set "GITHUB_TOKEN=123456"
set "GITHUB_API_URL=http://127.0.0.1"
:: 代码提示代理
set "completionsUrl=http://127.0.0.1"
set "telemetryUrl=http://127.0.0.1/telemetry"
set "CODESPACES=true"
set "GITHUB_SERVER_URL=https://github.com"
...略...
```
#### 2.测试
全部接口代理后是走一个ip了虽然不知道有没有意义
如果你是贩子,甚至可以搞点有意思的东西
![输入图片说明](ceshi.gif)
## **jetbrains**
代理服务器是支持的,插件我不会改,等个有缘人
我修改了插件里面js文件里面的接口改为自己的然后重新构建成exe
打包后有问题,可以运行,代理联网等都正常
但是代码提示无法在ide里面显示
目前找不到原因不懂node.js
![](https://foruda.gitee.com/images/1695118855841319485/b2c3c89e_8829470.png)