这边看到是流量回放到其他端口,如果线上环境回放到测试环境的话,线上和 测试环境URL中没有端口,只是区分租户,这种怎么转发,比如线上的URL都是 https://buy.hotcloud.com.cn/,测试环境url都是 https://buy-test.hotcloud.com.cn/
直接写他们各自的url就可以了, 本质是里面填写的是url,如果没写端口,其实就是用的默认端口,http是80, https是443
这个URl是根据租户区分不同的测试和正式环境,只写url怎么知道是哪个租户的环境
一个是buy 一个是buy-test,这两个就不一样了吧。如果是非要细分到租户,租户的请求里url的某个参数可能也是不一样的,gor支持filter过滤,可用使用他的filter再加一层过滤,他是支持通过http的某个字段进行过滤的。你可以查下其中的文档。
https://github.com/buger/goreplay/wiki/Request-filtering
# only forward requests with an api version of 1.0x
gor --input-raw :8080 --output-http staging.com --http-allow-header api-version:^1\.0\d
# only forward requests NOT containing User-Agent header value "Replayed by Gor"
gor --input-raw :8080 --output-http staging.com --http-disallow-header "User-Agent: Replayed by Gor"