-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add http2 listener for grpc proxy #315
Conversation
…go-pixiu into feat-grpc-listener
Codecov Report
@@ Coverage Diff @@
## develop #315 +/- ##
===========================================
+ Coverage 38.89% 39.96% +1.06%
===========================================
Files 53 53
Lines 3121 3038 -83
===========================================
Hits 1214 1214
+ Misses 1778 1694 -84
- Partials 129 130 +1
Continue to review full report at Codecov.
|
Pls fix the problems from github action robot. |
pls fix the conflicts. |
# Conflicts: # pkg/listener/http/http_listener.go
- filter_chain_match: | ||
domains: | ||
- api.dubbo.com | ||
- api.pixiu.com | ||
filters: | ||
- name: dgp.filter.httpconnectionmanager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above, using its abbrevlation instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following envoy http_connection_manager. hcm or gcm for grpcconnectionmanager make too much information lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job
* split listener service interface * split listener service interface * update * update * update * update * add integration test * add integration test * update * fix golangci-lint * update * fix reviewdog * fix reviewdog * fix reviewdog * update for comment * rename to NetworkFilterChain * update Co-authored-by: Mark4z <36187602+mark4z@users.noreply.github.com> Co-authored-by: Xin.Zh <dragoncharlie@foxmail.com>
What this PR does:
具体修改
1 将 Listener 提取出 interface,方便对不同协议扩展,目前有 HTTP 和 HTTP2两个struct
详见 pkg/listener/http2/http2_listener.go 分别进行不同的监听
2 实现 GrpcConnectionManager 这个 NetworkFilter,和旧的 HttpConnectionManager 是并列的。
将接收到的 HTTP2 request 进行拷贝,根据path选取cluster和endpoint,使用http2connection发送拷贝后的request给upstream grpc 服务器,然后将response的header,statuscode,body和tailor写回到给客户端的 response中
详见 pkg/common/grpc/manager.go
3 配置文件修改,将 protocolType 从 Address 提升到 Listener,将FilterChain从数组改变成单独结构体(P.S. 主要change来源这里,因为改了大量配置文件)
详见 pkg/filterchain/filter_chain.go