Merge remote-tracking branch 'origin/master'

pull/192/head
xiaojunnuo 2022-03-06 15:48:13 +08:00
commit 3920f033a0
4 changed files with 63 additions and 34 deletions

View File

@ -297,6 +297,21 @@ Error: www.github.com:443, 代理请求超时
3、如果你是因为开着ds的情况下重启电脑导致无法上网你可以设置ds为开机自启
### 8、卸载应用后上不了网git请求不了
如果你在卸载应用前没有正常退出app就有可能无法上网。请按如下步骤操作恢复您的网络
1、关闭系统代理设置参见[手动关闭系统代理设置](./doc/recover.md)
2、执行下面的命令关闭git的代理设置(如果你开启过git.ext的开关)
```shell
git config --global --unset http.proxy
git config --global --unset https.proxy
```
3、执行下面的命令关闭npm的代理设置(如果你开启过npm加速的开关)
```shell
npm config delete proxy
npm config delete https-proxy
```
## 七、在其他程序使用
* [java程序使用](./doc/other.md#Java程序使用)
@ -335,12 +350,10 @@ npm run electron:build
1、 加群
<div style="display: flex; justify-content:space-around;">
<img style="margin-right:50px" height="230px" src="http://wxgroup.docmirror.cn/weixin/group/dev-sidecar/1qrcode.jpg">
<img height="230px" src="https://gitee.com/docmirror/dev-sidecar/raw/master/doc/qq_group.png">
</div>
2、 加作者好友
<div style="display: flex; justify-content:space-around;">
<img height="200px" src="https://gitee.com/docmirror/dev-sidecar/raw/master/doc/me.png">

View File

@ -21,7 +21,29 @@
plugin: {
overwall: {
targets: {
'*azureedge.net': true
'*azureedge.net': true,
'github.com': true,
'*wikimedia.org': true,
'v2ex.com': true,
'*cloudfront.net': true,
'*bing.com': true,
'*discourse-cdn.com': true,
'*gravatar.com': true,
'*docker.com': true,
'*vueuse.org': true,
'*elastic.co': true,
'*optimizely.com': true,
'*stackpathcdn.com': true,
'*fastly.net': true,
'*cloudflare.com': true,
'*233v2.com': true,
'*v2fly.org': true,
'*telegram.org': true,
'*amazon.com': true,
'*googleapis.com': true,
'*cloudflareinsights.com': true,
'*.intlify.dev': true,
'*segment.io': true
}
}
}

View File

@ -13,7 +13,26 @@ module.exports = {
'github.com': true,
'*wikimedia.org': true,
'v2ex.com': true,
'*azureedge.net': true
'*azureedge.net': true,
'*cloudfront.net': true,
'*bing.com': true,
'*discourse-cdn.com': true,
'*gravatar.com': true,
'*docker.com': true,
'*vueuse.org': true,
'*elastic.co': true,
'*optimizely.com': true,
'*stackpathcdn.com': true,
'*fastly.net': true,
'*cloudflare.com': true,
'*233v2.com': true,
'*v2fly.org': true,
'*telegram.org': true,
'*amazon.com': true,
'*googleapis.com': true,
'*cloudflareinsights.com': true,
'*.intlify.dev': true,
'*segment.io': true
},
pac: {
enabled: true,

View File

@ -93,40 +93,15 @@ function connect (req, cltSocket, head, hostname, port, dnsConfig, sniRegexpMap)
cltSocket.write('HTTP/1.1 200 Connection Established\r\n' +
'Proxy-agent: dev-sidecar\r\n' +
'\r\n')
log.info('proxy connect start', hostname)
proxySocket.write(head)
proxySocket.pipe(cltSocket)
cltSocket.pipe(proxySocket)
// let sniReplaced = false
// cltSocket.on('data', (chunk) => {
// // if (replaceSni && sniReplaced === false) {
// // const sniPackage = sniExtract(chunk)
// // if (sniPackage != null) {
// // sniReplaced = true
// // const bytes = Buffer.from(replaceSni)
// // const start = sniPackage.start
// // const length = sniPackage.length
// // for (let i = 0; i < length; i++) {
// // let char = 97 // a 的ascii
// // if (bytes.length > i) {
// // char = bytes[i]
// // }
// // chunk[start + i] = char
// // }
// // }
// // }
// if (sniReplaced === false) {
// sniReplaced = true
// chunk[chunk.length - 1] = 1
// }
// proxySocket.write(chunk)
// })
// cltSocket.on('end', () => {
// proxySocket.end()
// })
})
cltSocket.on('timeout', (e) => {
log.error('cltSocket timeout', e.message, hostname)
})
cltSocket.on('error', (e) => {
log.error('cltSocket error', e.message, hostname)
})