Git Product home page Git Product logo

Comments (7)

monkeyWie avatar monkeyWie commented on June 15, 2024

不代理的话应该从客户端入手吧,比如pac规则这种

from proxyee.

zzmgc4 avatar zzmgc4 commented on June 15, 2024

明白,我的问法有问题,应该是不希望截取被https解密的网址

from proxyee.

monkeyWie avatar monkeyWie commented on June 15, 2024

哦 你意思就是指定某些域名不走MITM,报文原始转发那种吧,目前还不支持,我看看怎么改下吧

from proxyee.

zzmgc4 avatar zzmgc4 commented on June 15, 2024

我现在做了一个正则匹配
private static final Pattern URL_PATTERN = Pattern.compile("(?i)(?:https?://)?([a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,})(?::\d+)?(?:/\S*)?");
else { // ssl和websocket的握手处理
ByteBuf byteBuf = (ByteBuf) msg;
Pattern pattern = Pattern.compile("^http");
String request = byteBuf.toString(CharsetUtil.UTF_8);
// 使用正则表达式从请求内容中获取网址信息
Matcher matcher = URL_PATTERN.matcher(request);
if (matcher.find()) {
String url = matcher.group(1);
System.out.println("Received request: " + request);
System.out.println("URL: " + url);
}
// 处理原始的请求内容
System.out.println("Received request: " + request);
//然后如果匹配成功,把HandleSsl设置为false
if (getServerConfig().isHandleSsl() && byteBuf.getByte(0) == 22) {// ssl握手

from proxyee.

monkeyWie avatar monkeyWie commented on June 15, 2024

域名在握手信息里是有的,直接拿就行了

from proxyee.

zzmgc4 avatar zzmgc4 commented on June 15, 2024

是在byteBuf 里面拿吗,因为这个https里面好像是加密的,拿不到

from proxyee.

monkeyWie avatar monkeyWie commented on June 15, 2024

刚刚提交了一版,你升级到1.7.5,可以参考下最新的示例:https://github.com/monkeyWie/proxyee/blob/master/src/test/java/com/github/monkeywie/proxyee/MimtMatchHttpProxyServer.java

from proxyee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.