# 下载并解压goreplay
wget https://github.com/buger/goreplay/releases/download/v1.0.0/gor_1.0.0_x64.tar.gz && tar -xvf gor_1.0.0_x64.tar.gz
# 转发流量,加header、加gor的日志打印
./gor --input-raw :8080 --output-http http://diffy-master-default:8880 --http-set-header "Debug-Log:1" --stats --output-http-stats
# 转发流量,加header,筛选多个URI
nohup ./gor --input-raw :8080 --output-http "http://diffy-master-default-0006:8880" --http-set-header "Debug-Log:1" --http-set-header "Endpoint-Uri:1" --http-allow-url "/aaa-bbb/ccc" --http-allow-url "/aaa-bbb/ddd" &
# 转发流量,重写URI
nohup ./gor --input-raw :8080 --output-http "http://xxx:8080" --http-rewrite-url "/aaa-bbb/([.\w+.+]):/d$1" &
# 转发流量,筛选header
./gor --input-raw :8080 --output-http "http://10.201.33.111:8880" --http-allow-header symbol:"^aaa|bbb|ccc" --http-allow-url /data/contains --http-set-header Debug-Log:1 --http-set-header Endpoint-Uri:1 --stats --output-http-stats
# 录流量,录制的流量文件追加到指定的文件名称 --output-file-append
nohup ./gor --input-raw :8080 --http-allow-url /data/contains --output-file-append --output-file=lllla.gor &
# 回放流量文件,循环回放 --input-file-loop
nohup ../gor --input-file "lllla.gor|1500%" --output-http "http://dddd-master:8080" --input-file-loop &
更多见官方文档