Skip to content

Commit dcec340

Browse files
author
romanlu
committed
添加filter
1 parent 82e6088 commit dcec340

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.github.kimmking.gateway.filter;
2+
3+
import io.netty.buffer.Unpooled;
4+
import io.netty.channel.ChannelHandlerContext;
5+
import io.netty.handler.codec.http.FullHttpRequest;
6+
7+
import java.nio.charset.Charset;
8+
9+
/**
10+
* @author romanlu
11+
* @date 2020-11-04 23:41
12+
* @Description:
13+
*/
14+
public class HttpRequestFilterImpl implements HttpRequestFilter {
15+
16+
@Override
17+
public void filter(FullHttpRequest fullRequest, ChannelHandlerContext ctx) {
18+
System.out.println("请求处理器1");
19+
ctx.channel().writeAndFlush(Unpooled.copiedBuffer("hello word1" , Charset.forName("gb2312")));
20+
}
21+
}

0 commit comments

Comments
 (0)