com.github.puhiayang.handler.response.SocksResponseHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easy-http-proxy Show documentation
Show all versions of easy-http-proxy Show documentation
support http/https proxy.类似于fiddler,由java编写,代码简单便于理解。支持http/https代理!
The newest version!
package com.github.puhiayang.handler.response;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* socks代理responseHandler
* created on 2019/10/28 15:56
*
* @author puhaiyang
*/
public class SocksResponseHandler extends ChannelInboundHandlerAdapter {
private Logger logger = LoggerFactory.getLogger(SocksResponseHandler.class);
private Channel clientChannel;
public SocksResponseHandler(Channel clientChannel) {
this.clientChannel = clientChannel;
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
//直接返回给客户端
ctx.channel().writeAndFlush(msg);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy