Install GoReplay on Ubuntu 24.04

Install GoReplay on Ubuntu 24.04

GoReplay is an open-source tool designed for capturing and replaying live HTTP traffic. It is commonly used for testing and debugging web applications. This tutorial demonstrates how to install GoReplay on Ubuntu 24.04.

Install GoReplay

Check the latest GoReplay version from the GitHub repository and store it in a variable:

GOREPLAY_VERSION=$(curl -s "https://api.github.com/repos/buger/goreplay/releases/latest" | grep -Po '"tag_name": "\K[0-9.]+')

Download GoReplay using determined version:

wget -qO goreplay.tar.gz https://github.com/buger/goreplay/releases/latest/download/gor_${GOREPLAY_VERSION}_x64.tar.gz

Extract executable to /usr/local/bin directory:

sudo tar xf goreplay.tar.gz -C /usr/local/bin gor

Remove unneeded archive file:

rm -rf goreplay.tar.gz

Testing GoReplay

To begin using GoReplay, ensure you have a web server running on your machine. For testing purposes, you can quickly start the server by running:

sudo gor file-server :80

The command will start a file server for the current directory on port 80.

Now run the command to listen for all network activity happening on port 80 and log it to stdout:

sudo gor --input-raw :80 --output-stdout

Open a web browser and go to http://<IP_ADDRESS>, where <IP_ADDRESS> is the IP address of the system. You should see that GoReplay outputs HTTP headers right to the terminal. Example:

GET / HTTP/1.1
Host: 192.168.0.227
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9

Uninstall GoReplay

To uninstall GoReplay, delete the associated file:

sudo rm -rf /usr/local/bin/gor

Leave a Comment

Cancel reply

Your email address will not be published.