现在想在upstream里面解析tcp消息获取到业务参数来进行流量分发 ,但不知道可不可以实现
3条回答 默认 最新
LIUANDONG 2019-03-06 19:08关注stream { server { listen 9000 so_keepalive=30m::10; content_by_lua_block{ local sock = ngx.req.socket(true) local reader = sock:receiveuntil("\r\n") local data, err, partial = reader() if not data then ngx.print("failed to read the data stream: ", err) end ngx.print("read the data stream: ", data) } } }评论 打赏 举报解决 1无用