refactor: 小修改
parent
91f44b77f5
commit
184e41c9f9
|
@ -161,7 +161,7 @@ const intercepts = {
|
|||
如果没有加速效果,请根据以下步骤进行排查
|
||||
|
||||
#### 1、请确认windows的代理设置处于勾选状态
|
||||
如果已经是勾选状态,那么先取消勾选确定,然后再勾选确定,再尝试查看是否有加速效果(目前win7必需要手动开关一下)。
|
||||
如果已经是勾选状态,那么先取消勾选确定,然后再勾选确定,再尝试查看是否有加速效果。
|
||||
如何打开查看windows代理设置:
|
||||
* win10: 开始->设置->网络和Internet->最下方代理
|
||||
* win7: 开始->控制面板->网络和Internet->网络和共享中心->左下角Internet选项->连接选项卡->局域网设置
|
||||
|
|
|
@ -66,18 +66,20 @@ module.exports = {
|
|||
'.*': { proxy: 'raw.fastgit.org' }
|
||||
},
|
||||
'github.githubassets.com': {
|
||||
'.*': { proxy: 'assets.fastgit.org', test: 'https://github.githubassets.com/favicons/favicon.svg', desc: '静态资源加速' }
|
||||
|
||||
'.*': {
|
||||
proxy: 'assets.fastgit.org',
|
||||
backup: ['github.githubassets.com'],
|
||||
test: 'https://github.githubassets.com/favicons/favicon.svg',
|
||||
desc: '静态资源加速'
|
||||
}
|
||||
},
|
||||
'customer-stories-feed.github.com': {
|
||||
'.*': { proxy: 'customer-stories-feed.fastgit.org' }
|
||||
},
|
||||
|
||||
// google cdn
|
||||
'ajax.googleapis.com': {
|
||||
'.*': {
|
||||
proxy: 'ajax.loli.net',
|
||||
backup: ['ajax.proxy.ustclug.org'],
|
||||
test: 'ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'
|
||||
}
|
||||
},
|
||||
|
@ -102,8 +104,8 @@ module.exports = {
|
|||
},
|
||||
'fonts.gstatic.com': {
|
||||
'.*': {
|
||||
proxy: 'fonts-gstatic.proxy.ustclug.org',
|
||||
backup: ['gstatic.loli.net']
|
||||
proxy: 'gstatic.loli.net',
|
||||
backup: ['fonts-gstatic.proxy.ustclug.org']
|
||||
}
|
||||
},
|
||||
'clients*.google.com': { '.*': { abort: true } },
|
||||
|
|
|
@ -43,7 +43,7 @@ async function _winUnsetProxy (exec) {
|
|||
_winAsyncRegSet(regKey, 'ProxyServer', Registry.REG_SZ, '')
|
||||
])
|
||||
log.info('代理关闭成功,等待refresh')
|
||||
await exec(refreshInternetPs, { type: 'ps' })
|
||||
await exec(['echo "do refresh"', refreshInternetPs], { type: 'ps' })
|
||||
log.info('代理关闭refresh完成')
|
||||
return true
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ async function _winSetProxy (exec, ip, port) {
|
|||
_winAsyncRegSet(regKey, 'ProxyOverride', Registry.REG_SZ, lanIpStr)
|
||||
])
|
||||
log.info('代理设置成功,等待refresh')
|
||||
await exec(refreshInternetPs)
|
||||
await exec(['echo "do refresh"', refreshInternetPs], { type: 'ps' })
|
||||
log.info('代理设置refresh完成')
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -3,8 +3,10 @@ const config = require('../config/index')
|
|||
function getDefaultConfigBasePath () {
|
||||
return config.server.setting.userBasePath
|
||||
}
|
||||
const path = require('path')
|
||||
const filename = path.join(getDefaultConfigBasePath(), '/logs/core.log')
|
||||
log4js.configure({
|
||||
appenders: { std: { type: 'stdout' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename: getDefaultConfigBasePath() + '/logs/core.log' } },
|
||||
appenders: { std: { type: 'stdout' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename } },
|
||||
categories: { default: { appenders: ['file', 'std'], level: 'info' } }
|
||||
})
|
||||
const logger = log4js.getLogger('server')
|
||||
|
|
|
@ -3,8 +3,10 @@ const DevSidecar = require('@docmirror/dev-sidecar')
|
|||
const getDefaultConfigBasePath = function () {
|
||||
return DevSidecar.api.config.get().server.setting.userBasePath
|
||||
}
|
||||
const path = require('path')
|
||||
const filename = path.join(getDefaultConfigBasePath(), '/logs/gui.log')
|
||||
log4js.configure({
|
||||
appenders: { std: { type: 'stdout' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename: getDefaultConfigBasePath() + '/logs/gui.log' } },
|
||||
appenders: { std: { type: 'stdout' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename } },
|
||||
categories: { default: { appenders: ['file', 'std'], level: 'info' } }
|
||||
})
|
||||
const logger = log4js.getLogger('server')
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
const log4js = require('log4js')
|
||||
const proxyConfig = require('../lib/proxy/common/config')
|
||||
const path = require('path')
|
||||
const filename = path.join(proxyConfig.getDefaultCABasePath(), '/logs/server.log')
|
||||
log4js.configure({
|
||||
appenders: { std: { type: 'stdout', level: 'debug' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename: proxyConfig.getDefaultCABasePath() + '/logs/server.log' } },
|
||||
appenders: { std: { type: 'stdout', level: 'debug' }, file: { type: 'file', pattern: 'yyyy-MM-dd', daysToKeep: 3, filename } },
|
||||
categories: { default: { appenders: ['file', 'std'], level: 'info' } }
|
||||
})
|
||||
const logger = log4js.getLogger('server')
|
||||
|
|
Loading…
Reference in New Issue