Thanks to visit codestin.com
Credit goes to github.com

Skip to content
forked from monkeyWie/proxyee

java实现http代理服务器,支持https,websocket。可拦截处理http、https报文

aprchen/proxyee

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java实现HTTP代理服务器

支持HTTP、HTTPS、WebSocket,HTTPS采用动态签发证书,可以拦截http、https的报文并进行处理。
例如:http(s)协议抓包,http(s)动态替换请求内容或响应内容等等。

HTTPS支持

需要导入项目中的CA证书(src/resources/ca.crt)至受信任的根证书颁发机构.

原生java实现(仅做为demo,不支持拦截)

    new NativeHttpProxyServer().start(9002);

基于netty实现

    new NettyHttpProxyServer().start(9001);
    //拦截处理
    new NettyHttpProxyServer().initProxyInterceptFactory(() -> new HttpProxyIntercept() {
    
                @Override
                public boolean afterResponse(Channel clientChannel, Channel proxyChannel, HttpResponse httpResponse) {
                    //拦截响应,添加一个响应头
                    httpResponse.headers().add("intercept","test");
                    return true;
                }
    
            }).start(8999);

流程

SSL握手

SSL握手

HTTP通讯

HTTP通讯

About

java实现http代理服务器,支持https,websocket。可拦截处理http、https报文

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%