• evnoy协议转换关键日志


    http协议

    client代理端

    建立连接过程:

    new connection from 172.17.0.1:58074
    
    • 1

    进来的简单的协议头

    ':authority', 'localhost:9001'
    ':path', '/service1/hello'
    ':method', 'GET'
    'user-agent', 'curl/7.54.0'
    'accept', '*/*'
    'x-host-port', '192.168.65.2:9003'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    定位到具体的cluster

    cluster 'remote-proxy-with-bridge' match for URL '/service1/hello'
    
    • 1

    router decoding headers:

    ':authority', 'localhost:9001'
    ':path', '/service1/hello'
    ':method', 'GET'
    ':scheme', 'http'
    'user-agent', 'curl/7.54.0'
    'accept', '*/*'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-internal', 'true'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', 'bd2f2ecb-eb7b-4127-a6f3-37e6d549e766'
    'x-envoy-expected-rq-timeout-ms', '15000'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    响应接收完结

    upstream headers complete:
    
    • 1

    响应头解析

    ':status', '200'
    'content-type', 'application/json; charset=UTF-8'
    'date', 'Fri, 15 Sep 2023 03:08:36 GMT'
    'content-length', '79'
    'x-envoy-upstream-service-time', '19'
    'server', 'envoy'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    sever代理端

    request headers complete
    
    • 1
    ':authority', 'localhost:9001'
    ':path', '/service1/hello'
    ':method', 'GET'
    'user-agent', 'curl/7.54.0'
    'accept', '*/*'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-internal', 'true'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', '819f5aa5-47f0-4c40-a15a-d42ebe00cfd3'
    'x-envoy-expected-rq-timeout-ms', '15000'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    router decoding headers

    ':authority', 'localhost:9001'
    ':path', '/service1/hello'
    ':method', 'GET'
    ':scheme', 'http'
    'user-agent', 'curl/7.54.0'
    'accept', '*/*'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', '819f5aa5-47f0-4c40-a15a-d42ebe00cfd3'
    'x-envoy-expected-rq-timeout-ms', '15000'
    'x-envoy-internal', 'true'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    ws协议

    client代理端

    建立连接过程:

    new connection from 172.17.0.1:58116
    
    • 1

    进来的简单的协议头

    ':authority', 'localhost:9001'
    ':path', '/service1/ws'
    ':method', 'GET'
    'user-agent', 'Go-http-client/1.1'
    'connection', 'Upgrade'
    'sec-websocket-key', 'fsiMQm1+MlhrHYwTCU2KiQ=='
    'sec-websocket-version', '13'
    'upgrade', 'websocket'
    'x-host-port', '192.168.65.2:9003'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    定位到具体的cluster

    cluster 'remote-proxy-with-bridge' match for URL '/service1/hello'
    
    • 1

    router decoding headers:

    ':authority', 'localhost:9001'
    ':path', '/service1/ws'
    ':method', 'GET'
    ':scheme', 'http'
    'user-agent', 'Go-http-client/1.1'
    'connection', 'Upgrade'
    'sec-websocket-key', 'fsiMQm1+MlhrHYwTCU2KiQ=='
    'sec-websocket-version', '13'
    'upgrade', 'websocket'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-internal', 'true'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', 'ce929aa5-51f4-49bd-962c-11ba7f14dfac'
    'x-envoy-expected-rq-timeout-ms', '15000'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    响应接收完结

    upstream headers complete:
    
    • 1

    响应头解析

    ':status', '101'
    'upgrade', 'websocket'
    'connection', 'Upgrade'
    'sec-websocket-accept', 'XkJsGcXLbGlJS2mfjezPFvlzXe8='
    'date', 'Fri, 15 Sep 2023 03:34:17 GMT'
    'server', 'envoy'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    sever代理端

    request headers complete
    
    • 1
    ':authority', 'localhost:9001'
    ':path', '/service1/ws'
    ':method', 'GET'
    'user-agent', 'Go-http-client/1.1'
    'connection', 'Upgrade'
    'sec-websocket-key', '8gFWTeasO9X7GEz+vE1g5A=='
    'sec-websocket-version', '13'
    'upgrade', 'websocket'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-internal', 'true'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', 'b616b702-5694-404e-b5d5-ff29582358ad'
    'x-envoy-expected-rq-timeout-ms', '15000'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    router decoding headers

    ':status', '101'
    'upgrade', 'websocket'
    'connection', 'Upgrade'
    'sec-websocket-accept', 'W1mTzJ1NmaG6OlUbesHe3mmIXOQ='
    'date', 'Fri, 15 Sep 2023 03:40:48 GMT'
    'server', 'envoy'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    socket-http协议

    sever代理端

    request headers complete
    
    • 1
    ':authority', '192.168.65.2:10001'
    ':method', 'CONNECT'
    
    • 1
    • 2

    router decoding headers

    ':authority', '192.168.65.2:10001'
    ':method', 'CONNECT'
    ':scheme', 'https'
    'x-forwarded-proto', 'https'
    'x-request-id', 'a8b53a8d-69b8-47fc-a224-661e4fb7915e'
    'x-envoy-expected-rq-timeout-ms', '15000'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    响应值

    ':status', '200'
    'date', 'Fri, 15 Sep 2023 04:36:39 GMT'
    'server', 'envoy'
    
    • 1
    • 2
    • 3

    grpc-http协议

    client代理端

    建立连接过程:

    new connection from 172.17.0.1:58116
    
    • 1

    进来的简单的协议头

    ':method', 'POST'
    ':scheme', 'http'
    ':path', '/kv.KV/Set'
    ':authority', 'localhost:9001'
    'content-type', 'application/grpc'
    'user-agent', 'grpc-go/1.47.0'
    'te', 'trailers'
    'x-host-port', '192.168.65.2:9003'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    定位到具体的cluster

    cluster 'remote-proxy-with-bridge' match for URL '/kv.KV/Set'
    
    • 1

    router decoding headers:

    ':method', 'POST'
    ':scheme', 'http'
    ':path', '/kv.KV/Set'
    ':authority', 'localhost:9001'
    'content-type', 'application/grpc'
    'user-agent', 'grpc-go/1.47.0'
    'te', 'trailers'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-internal', 'true'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', '76ad8264-c774-4237-98b7-7a8f7ff47fae'
    'accept', 'application/grpc'
    'x-envoy-expected-rq-timeout-ms', '15000'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    响应接收完结

    upstream headers complete:
    
    • 1

    响应头解析

    ':status', '200'
    'content-type', 'application/grpc'
    'x-envoy-upstream-service-time', '15'
    'date', 'Fri, 15 Sep 2023 05:16:45 GMT'
    'server', 'envoy'
    
    • 1
    • 2
    • 3
    • 4
    • 5

    sever代理端

    request headers complete
    
    • 1
    ':method', 'POST'
    ':scheme', 'http'
    ':path', '/kv.KV/Set'
    ':authority', 'localhost:9001'
    'content-type', 'application/grpc'
    'user-agent', 'grpc-go/1.47.0'
    'te', 'trailers'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-internal', 'true'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', '76ad8264-c774-4237-98b7-7a8f7ff47fae'
    'accept', 'application/grpc'
    'x-envoy-expected-rq-timeout-ms', '15000'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    router decoding headers

    ':method', 'POST'
    ':scheme', 'http'
    ':path', '/kv.KV/Set'
    ':authority', 'localhost:9001'
    'content-type', 'application/grpc'
    'user-agent', 'grpc-go/1.47.0'
    'te', 'trailers'
    'x-host-port', '192.168.65.2:9003'
    'x-forwarded-for', '172.17.0.1'
    'x-forwarded-proto', 'http'
    'x-envoy-downstream-service-cluster', ''
    'x-request-id', '76ad8264-c774-4237-98b7-7a8f7ff47fae'
    'accept', 'application/grpc'
    'x-envoy-expected-rq-timeout-ms', '15000'
    'x-envoy-internal', 'true'
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    upstream headers complete: end_stream=false

    ':status', '200'
    'content-type', 'application/grpc'
    'x-envoy-upstream-service-time', '4'
    'date', 'Fri, 15 Sep 2023 05:16:45 GMT'
    'server', 'envoy'
    
    • 1
    • 2
    • 3
    • 4
    • 5
  • 相关阅读:
    聊聊Promise的使用
    sylar高性能服务器-日志(P1-P6)代码解析+调试分析
    【Java】涉及到GUI、JAVASE、网络编程、多线程、数据库的聊天系统,非常适合大学Java课程的练手
    用DIV+CSS技术制作一个简单的网页 我的家乡主题
    redis故障中出现的缓存击穿、缓存穿透、缓存雪崩?
    从Nand Cell到Nand Chip
    【世界历史】第一集——石器时代的人们
    计及需求响应和电能交互的多主体综合能源系统主从博弈优化调度策略(含matlab代码)
    设计模式之桥接模式
    caspase-2 酶抑制剂有望治疗非酒精性脂肪肝
  • 原文地址:https://blog.csdn.net/xihuanyuye/article/details/132897772