optimize: 移除 sniList 相关的代码,因为已经没在使用。

pull/375/head
王良 1 month ago
parent d97ec57797
commit 938ca58421

@ -347,9 +347,6 @@ module.exports = {
'*.baidu.com': true,
'192.168.*': true
},
sniList: {
// 'github.com': 'abaidu.com'
},
dns: {
providers: {
aliyun: {

@ -238,7 +238,6 @@ export default {
dnsMappings: [],
speedTestList: [],
whiteList: []
// sniList: []
}
},
created () {
@ -277,7 +276,6 @@ export default {
ready () {
this.initDnsMapping()
this.initWhiteList()
// this.initSniList()
if (this.config.server.dns.speedTest.dnsProviders) {
this.speedDns = this.config.server.dns.speedTest.dnsProviders
}
@ -285,7 +283,6 @@ export default {
async applyBefore () {
this.submitDnsMapping()
this.submitWhiteList()
// this.submitSniList()
},
async applyAfter () {
if (this.status.server.enabled) {

@ -17,7 +17,7 @@ function isSslConnect (sslConnectInterceptors, req, cltSocket, head) {
}
// create connectHandler function
module.exports = function createConnectHandler (sslConnectInterceptor, middlewares, fakeServerCenter, dnsConfig, sniConfig) {
module.exports = function createConnectHandler (sslConnectInterceptor, middlewares, fakeServerCenter, dnsConfig) {
// return
const sslConnectInterceptors = []
sslConnectInterceptors.push(sslConnectInterceptor)
@ -27,11 +27,11 @@ module.exports = function createConnectHandler (sslConnectInterceptor, middlewar
}
}
// log.info('sni config:', sniConfig)
// const sniRegexpMap = matchUtil.domainMapRegexply(sniConfig)
return function connectHandler (req, cltSocket, head) {
// eslint-disable-next-line node/no-deprecated-api
const { hostname, port } = url.parse(`https://${req.url}`)
let { hostname, port } = url.parse(`https://${req.url}`)
port = parseInt(port)
if (isSslConnect(sslConnectInterceptors, req, cltSocket, head)) {
// 需要拦截代替目标服务器让客户端连接DS在本地启动的代理服务
fakeServerCenter.getServerPromise(hostname, port).then((serverObj) => {

@ -20,8 +20,7 @@ module.exports = {
middlewares = [],
externalProxy,
dnsConfig,
setting,
sniConfig
setting
}, callback) {
// Don't reject unauthorized
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
@ -76,8 +75,7 @@ module.exports = {
sslConnectInterceptor,
middlewares,
fakeServersCenter,
dnsConfig,
sniConfig
dnsConfig
)
const server = new http.Server()

@ -99,7 +99,6 @@ module.exports = (serverConfig) => {
speedTest: serverConfig.dns.speedTest
},
setting,
sniConfig: serverConfig.sniList,
middlewares,
sslConnectInterceptor: (req, cltSocket, head) => {
const hostname = req.url.split(':')[0]

Loading…
Cancel
Save