diff --git a/README.md b/README.md index 09eff11..ed3ae21 100644 --- a/README.md +++ b/README.md @@ -256,6 +256,9 @@ networksetup -setwebproxy 'WiFi' 127.0.0.1 1181 ### 3、浏览器打开提示证书不受信任 +![](./doc/crt-error.png) +一般是证书安装位置不对,重新安装证书后,重启浏览器 + #### 3.1 windows: 请确认证书已正确安装在“信任的根证书颁发机构”下 #### 3.2 mac: 请确认证书已经被安装并已经设置信任。 @@ -268,12 +271,13 @@ networksetup -setwebproxy 'WiFi' 127.0.0.1 1181 > 4、勾选信任由此证书颁发机构来标识网站,确定即可 ### 4. 打开github显示连接超时 - ```html +```html DevSidecar Warning: Error: www.github.com:443, 代理请求超时 ``` -如果是安全模式,则是因为不稳定导致的,等一会再刷新试试 -如果是增强模式,则是由于访问人数过多,正常现象 +1、检查测速界面github.com是否有ip ,如果没有ip,则可能是由于你的网络提供商封锁了dns服务商的ip(试试能否ping通:1.1.1.1 / 9.9.9.9 ) +2、如果是安全模式,则是因为不稳定导致的,等一会再刷新试试 +3、如果是增强模式,则是由于访问人数过多,正常现象 ### 5、查看日志是否有报错 如果还是不行,请在下方加作者好友,将服务日志发送给作者进行分析 diff --git a/doc/crt-error.png b/doc/crt-error.png new file mode 100644 index 0000000..79646c4 Binary files /dev/null and b/doc/crt-error.png differ diff --git a/lerna.json b/lerna.json index 56f2c6f..a1d42d8 100644 --- a/lerna.json +++ b/lerna.json @@ -14,5 +14,5 @@ "ignore": [] } }, - "version": "1.7.2" + "version": "1.7.3" } diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 4a1209a..a46cee2 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -1,6 +1,6 @@ { "name": "@docmirror/dev-sidecar", - "version": "1.7.2", + "version": "1.7.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index 55a8ae4..dcd53e5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@docmirror/dev-sidecar", - "version": "1.7.2", + "version": "1.7.3", "description": "给开发者的加速代理工具", "main": "src/index.js", "keywords": [ @@ -17,7 +17,7 @@ "test": "mocha" }, "dependencies": { - "@docmirror/mitmproxy": "^1.7.2", + "@docmirror/mitmproxy": "^1.7.3", "agentkeepalive": "^2.1.1", "babel-preset-es2020": "^1.0.2", "charset": "^1.0.0", diff --git a/packages/core/src/config/remote_config.json5 b/packages/core/src/config/remote_config.json5 index 97f7d8f..569f267 100644 --- a/packages/core/src/config/remote_config.json5 +++ b/packages/core/src/config/remote_config.json5 @@ -6,12 +6,18 @@ proxy: 'github.githubassets.com', sni: 'baidu.com', } + }, + "www.gstatic.com": { + "/recaptcha/.*": { + "proxy": "www.recaptcha.net" + } } }, dns: { mapping: { '*jetbrains.com': 'quad9', - '*azureedge.net': 'quad9' + '*azureedge.net': 'quad9', + '*stackoverflow.com': 'quad9' }, speedTest: { interval: 300000, diff --git a/packages/core/src/modules/plugin/node/config.js b/packages/core/src/modules/plugin/node/config.js index 13c182f..ef478af 100644 --- a/packages/core/src/modules/plugin/node/config.js +++ b/packages/core/src/modules/plugin/node/config.js @@ -17,7 +17,7 @@ module.exports = { // 'cdn.cypress.io': [{ regexp: '/desktop/.*', proxy: 'http://npmmirror.com/mirrors/cypress/' }] // }, variables: { - phantomjs_cdnurl: 'https://npmmirror.com/dist/phantomjs', + phantomjs_cdnurl: 'https://npmmirror.com/mirrors/phantomjs', chromedriver_cdnurl: 'https://npmmirror.com/mirrors/chromedriver', sass_binary_site: 'https://npmmirror.com/mirrors/node-sass', ELECTRON_MIRROR: 'https://npmmirror.com/mirrors/electron/', diff --git a/packages/gui/package.json b/packages/gui/package.json index 46e8cf6..f94eeb7 100644 --- a/packages/gui/package.json +++ b/packages/gui/package.json @@ -1,6 +1,6 @@ { "name": "@docmirror/dev-sidecar-gui", - "version": "1.7.2", + "version": "1.7.3", "private": false, "license": "MPL-2.0", "main": "background.js", @@ -21,8 +21,8 @@ "name": "Greper" }, "dependencies": { - "@docmirror/dev-sidecar": "^1.7.2", - "@docmirror/mitmproxy": "^1.7.2", + "@docmirror/dev-sidecar": "^1.7.3", + "@docmirror/mitmproxy": "^1.7.3", "adm-zip": "^0.5.5", "ant-design-vue": "^1.6.5", "compressing": "^1.5.1", diff --git a/packages/mitmproxy/package.json b/packages/mitmproxy/package.json index b9980b8..71c0a35 100644 --- a/packages/mitmproxy/package.json +++ b/packages/mitmproxy/package.json @@ -1,6 +1,6 @@ { "name": "@docmirror/mitmproxy", - "version": "1.7.2", + "version": "1.7.3", "description": "", "main": "src/index.js", "keywords": [ diff --git a/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js b/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js index 7e57b2d..f80f249 100644 --- a/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js +++ b/packages/mitmproxy/src/lib/proxy/mitmproxy/createRequestHandler.js @@ -36,8 +36,12 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e if (interceptors == null) { interceptors = [] } - const reqIncpts = interceptors.filter(item => { return item.requestIntercept != null }) - const resIncpts = interceptors.filter(item => { return item.responseIntercept != null }) + const reqIncpts = interceptors.filter(item => { + return item.requestIntercept != null + }) + const resIncpts = interceptors.filter(item => { + return item.responseIntercept != null + }) const requestInterceptorPromise = () => { return new Promise((resolve, reject) => { @@ -131,12 +135,20 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e } } + // rOptions.sigalgs = 'RSA-PSS+SHA256:RSA-PSS+SHA512:ECDSA+SHA256' + // rOptions.agent.options.sigalgs = rOptions.sigalgs + // rOptions.ciphers = 'TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256:ECDHE-RSA-AES256-SHA256:HIGH' + // rOptions.agent.options.ciphers = rOptions.ciphers + // console.log('rOptions:', rOptions) + // console.log('agent:', rOptions.agent) + // console.log('agent.options:', rOptions.agent.options) proxyReq = (rOptions.protocol === 'https:' ? https : http).request(rOptions, (proxyRes) => { const end = new Date().getTime() const cost = end - start if (rOptions.protocol === 'https:') { log.info('代理请求返回:', url, cost + 'ms') } + // console.log('request:', proxyReq, proxyReq.socket) if (cost > MAX_SLOW_TIME) { countSlow(isDnsIntercept, 'to slow ' + cost + 'ms') } @@ -243,7 +255,10 @@ module.exports = function createRequestHandler (createIntercepts, middlewares, e body += append.body } } - InsertScriptMiddleware.responseInterceptor(req, res, proxyReq, proxyRes, ssl, next, { head, body }) + InsertScriptMiddleware.responseInterceptor(req, res, proxyReq, proxyRes, ssl, next, { + head, + body + }) } else { next() }