# 网络代理
再天朝上国使用互联网经常会出现网络问题,此时需要特殊手段来进行配置,以实现正常使用
> [!tips] 因为使用的是`clash` 所以默认的端口为`7890`,有需要自行换

## 前端相关
### npm 配置代理
#### 设置代理
```shell
npm config set proxy http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890
```
#### 更换镜像源
> [!tips] 切换源后会导致各种奇怪的问题.   
> 不建议使用第三方源或者http源

配置http源
```shell
npm config set registry=http://registry.npmjs.org
```

#### 移除配置
> configName 为配置项的名称

npm config delete [configName]  

`#d` 删除镜像源配置
```shell
npm config delete registry
```

### yarn 代理设置
```shell
yarn config set proxy  http://127.0.0.1:7890
yarn config set https-proxy http://127.0.0.1:7890
```


### cmd 配置代理
```shell
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890
```