源代码中所有的 1181 替换为 31181

pull/333/head
王良 3 months ago
parent 5b4bcdda92
commit 1173ee9096

@ -239,7 +239,7 @@ const intercepts = {
#### 1Mac系统使用时首页的系统代理开关无法打开
出现这个问题可能是没有开启系统代理命令的执行权限
```
networksetup -setwebproxy 'WiFi' 127.0.0.1 1181
networksetup -setwebproxy 'WiFi' 127.0.0.1 31181
#看是否有如下错误提示
** Error: Command requires admin privileges.
```

@ -6,11 +6,11 @@
需要先通过keytool安装证书
`keytool -import -alias dev-sidecar -keystore "jdk路径\security\cacerts" -file 用户目录\.dev-sidecar\dev-sidecar.ca.crt`默认密码为`changeit`
启动时还需要设置参数
`-Dhttp.proxyHost=localhost -Dhttp.proxyPort=1181 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=1181`
`-Dhttp.proxyHost=localhost -Dhttp.proxyPort=31181 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=31181`
Gradle还需在`用户目录/.gradle/gradle.properties`创建配置文件
```properties
systemProp.http.proxyHost=localhost
systemProp.http.proxyPort=1181
systemProp.http.proxyPort=31181
systemProp.https.proxyHost=localhost
systemProp.https.proxyPort=1181
systemProp.https.proxyPort=31181
```

@ -38,7 +38,7 @@ const request = require('request')
const fs = require('fs')
request({
url: 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js',
proxy: 'http://127.0.0.1:1181',
proxy: 'http://127.0.0.1:31181',
ca: fs.readFileSync('C:/Users/Administrator/.dev-sidecar/dev-sidecar.ca.crt')
// eslint-disable-next-line handle-callback-err
}, (err, res, body) => {

@ -44,6 +44,9 @@ module.exports = {
}
res.setHeader('DS-RequestReplace-Interceptor', actions)
const url = `${rOptions.method}${rOptions.protocol}//${rOptions.hostname}:${rOptions.port}${req.url}`
log.info('requestReplace intercept:', url)
},
is (interceptOpt) {
return !!interceptOpt.requestReplace

@ -7,7 +7,7 @@ config.caKeyFileName = 'dev-sidecar.ca.key.pem'
config.defaultHost = '127.0.0.1'
config.defaultPort = 1181
config.defaultPort = 31181
config.caName = 'DevSidecar - This certificate is generated locally'

@ -28,13 +28,13 @@
// const https = require('https')
// const fs = require('fs')
// process.env.NODE_EXTRA_CA_CERTS = 'C:\\Users\\Administrator\\.dev-sidecar\\dev-sidecar.ca.crt'
// process.env.GLOBAL_AGENT_HTTP_PROXY = "http://127.0.0.1:1181"
// process.env.GLOBAL_AGENT_HTTPS_PROXY = "http://127.0.0.1:1181"
// process.env.GLOBAL_AGENT_HTTP_PROXY = "http://127.0.0.1:31181"
// process.env.GLOBAL_AGENT_HTTPS_PROXY = "http://127.0.0.1:31181"
// fs.readFileSync(process.env.NODE_EXTRA_CA_CERTS)
//
// const options = {
// agent : new https.Agent({
// proxy: "http://127.0.0.1:1181"
// proxy: "http://127.0.0.1:31181"
// })
// }
// console.log('options', options)
@ -55,7 +55,7 @@ function testRequest(){
// process.env.NODE_EXTRA_CA_CERTS='C:\\Users\\Administrator\\.dev-sidecar\\dev-sidecar.ca.crt'
console.log(process.env.NODE_EXTRA_CA_CERTS)
const request = require("request").defaults({
proxy: "http://127.0.0.1:1181"
proxy: "http://127.0.0.1:31181"
})
request("https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js",(error, response, body)=>{
if(error){

Loading…
Cancel
Save