当前位置: 首页 > news >正文

Goreplay最新版本的安装和简单使用

一:概述

        Gor 是一个开源工具,用于捕获实时 HTTP 流量并将其重放到测试环境中,以便使用真实数据持续测试您的系统。它可用于提高对代码部署、配置更改和基础设施更改的信心。简单易用。

项目地址:buger/goreplay: GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.https://github.com/buger/goreplay?tab=readme-ov-file

        GoReplay 提供了一种独特的阴影方法。GoReplay 不是代理,而是在后台侦听网络接口上的流量,无需更改生产基础设施,只需在与服务相同的计算机上运行 GoReplay 守护程序即可。

二:具体说明

        2.1 Golang环境安装以及配置

              去此页面  All releases - The Go Programming Language下载

这个是配置GO环境的,然后一开始那个项目地址可以下载最新的Goreplay的tar包。

        2.1.1 解压到/usr/local/soft/Go

tar -zxvf go1.24.3.linux-amd64.tar.gz && rm go1.24.3.linux-amd64.tar.gz

        2.1.2 配置环境变量

pwd
/usr/local/soft/Go/go
[root@localhost go]# vim /etc/profileexport GOROOT=/usr/local/soft/Go/go
export $PATH=$PATH:GOROOT/bin
# 编译生效
source /etc/profile

        配置完成之后,输入以下命令可以查看Golang的版本

[root@localhost go]# go version
go version go1.24.3 linux/amd64

       2.2 安装Goreplay 

                2.2.1 解压文件到/usr/local/soft/goreplay

tar -zxvf gor_1.3.3_x64.tar.gz && rm -f gor_1.3.3_x64.tar.gz[root@localhost goreplay]# ls
gor

2.3 测试案例

        2.3.1 利用python开启一个自带的http服务

python3.13 -m http.server

        前提是你已经安装了python

[root@localhost python]# python3.13 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...

2.3.2重新开一个服务器窗口在/usr/local/soft/goreplay目录执行命令

./gor --input-raw :8000 --output-stdout

./gor --input-raw :8000 --output-file requests.log
./gor --input-raw  ip:8000 --output-file requests.log
./gor --input-file requests.log --output-http  http://ip:8000
[DEBUG][elapsed 338.732µs]: [INPUT-FILE] No files match pattern:  requests.log
2025/06/01 17:44:12 [PPID 118115 and PID 161981] Version:1.3.0

相关文章:

  • windows下,release的dll给debug模式用,可以吗,比如zlib,freetype库
  • Linux 内核中 skb_dst_drop 的深入解析:路由缓存管理与版本实现差异
  • 【模拟电子电路-工具使用】
  • [Godot] 如何导出安卓 APK 并在手机上调试
  • 论文略读:Uncertainty-Aware Graph Structure Learning
  • 【linux】知识梳理
  • 封闭内网安装配置VSCode Anconda3 并配置 PyQt5开发
  • 基于STM32的流水线机器人自动分拣系统设计与实现:技术、优化与应用
  • C++学习-入门到精通【12】文件处理
  • LabVIEW多按键自动化检测系统
  • 智慧交通设计方案
  • while循环判断数字位数
  • Word双栏英文论文排版攻略
  • c++面向对象第4天---拷贝构造函数与深复制
  • c++之字符串
  • [总结]前端性能指标分析、性能监控与分析、Lighthouse性能评分分析
  • 【项目记录】登录认证(上)
  • 神经网络与Transformer详解
  • 多端学习方案起笔
  • Linux《文件系统》
  • 网站后面的官网是如何做的/网站展示型推广
  • 北京市建设和城乡住房委员会/深圳网站设计实力乐云seo
  • 大气科技类企业公司网站源码/本周新闻热点
  • 网站开发笔试题/seo网站推广建站服务商
  • 网站无后台可以上框架/百度平台app下载
  • 建设部的官方网站/seo搜索引擎优化ppt