2024-09-25 01:45:06 +00:00
|
|
|
const HttpsAgent = require('@docmirror/mitmproxy/src/lib/proxy/common/ProxyHttpsAgent')
|
2024-11-15 04:04:00 +00:00
|
|
|
const request = require('request')
|
2024-09-25 01:45:06 +00:00
|
|
|
|
|
|
|
const options = {
|
|
|
|
url: 'https://raw.githubusercontent.com/docmirror/dev-sidecar/refs/heads/master/packages/core/src/config/remote_config.json5',
|
2025-01-10 07:10:15 +00:00
|
|
|
// url: 'https://gitee.com/wangliang181230/dev-sidecar/raw/docmirror2.x/packages/core/src/config/remote_config.json',
|
2024-09-25 01:45:06 +00:00
|
|
|
servername: 'baidu.com',
|
|
|
|
agent: new HttpsAgent({
|
|
|
|
keepAlive: true,
|
|
|
|
timeout: 20000,
|
|
|
|
keepAliveTimeout: 30000,
|
2024-11-15 04:04:00 +00:00
|
|
|
rejectUnauthorized: false,
|
|
|
|
}),
|
2024-09-25 01:45:06 +00:00
|
|
|
}
|
|
|
|
if (options.agent.options) {
|
|
|
|
options.agent.options.rejectUnauthorized = false
|
|
|
|
console.info('options.agent.options.rejectUnauthorized = false')
|
|
|
|
}
|
|
|
|
|
|
|
|
request(options, (error, response, body) => {
|
2024-11-15 04:04:00 +00:00
|
|
|
console.info('error:', error, '\n---------------------------------------------------------------------------\n'
|
2024-11-15 05:57:19 +00:00
|
|
|
+ 'response:', response, '\n---------------------------------------------------------------------------\n'
|
|
|
|
+ 'body:', body)
|
2024-09-25 01:45:06 +00:00
|
|
|
})
|