Closed iwakura-lain closed 1 year ago
试试 curl -k -x 127.0.0.1:9999 https://www.baidu.com
试试 curl -k -x 127.0.0.1:9999 https://www.baidu.com 感谢回复,curl terminal 无日志,idea 打印了
17:40:32.669 [nioEventLoopGroup-3-1] DEBUG io.netty.handler.logging.LoggingHandler - [id: 0x457ca6cc, L:/0:0:0:0:0:0:0:0:9999] READ: [id: 0x46359987, L:/127.0.0.1:9999 - R:/127.0.0.1:62693] 17:40:32.670 [nioEventLoopGroup-3-1] DEBUG io.netty.handler.logging.LoggingHandler - [id: 0x457ca6cc, L:/0:0:0:0:0:0:0:0:9999] READ COMPLETE 17:40:32.980 [nioEventLoopGroup-4-2] DEBUG io.netty.handler.ssl.SslHandler - [id: 0x46359987, L:/127.0.0.1:9999 - R:/127.0.0.1:62693] HANDSHAKEN: protocol:TLSv1.2 cipher suite:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
我拿你代码跑了下没问题的啊
加上 -I 后重定向成功了
但是浏览器访问实际上还是没有跳转
控制台报错
18:15:42.650 [nioEventLoopGroup-4-1] DEBUG io.netty.handler.ssl.SslHandler - [id: 0x3ebee7db, L:/127.0.0.1:9999 - R:/127.0.0.1:63443] Swallowing a harmless 'connection reset by peer / broken pipe' error that occurred while writing close_notify in response to the peer's close_notify
java.io.IOException: Connection reset by peer
加这一行代码再试试:
hookResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0)
也不行
我这边测试是可以的啊,浏览器和curl都没问题,你加完之后curl也不行吗?
curl 没问题,重定向了;但是浏览器访问不行。。
charles 能正常代理
浏览器看起来没走代理啊
需要额外设置浏览器的代理吗?我以为是系统级的,现在使用 SwitchOmega 以后报了 npe
是必现的吗,如果能用curl重现出来那更好
感谢大佬,是插件的问题 在使用 SwitchOmega 的情况下,浏览器访问时必现,curl 重现不了
如果是手动设置系统代理的话,可以正常重定向
不要用https的代理协议,代理服务器只提供http协议,这样配置就行
懂了,感谢大佬
依赖版本为 1.7.0, 系统证书已设置