oha in Termux – Web and HTTP Testing Tool

oha is a command-line HTTP load testing tool that lets you measure the performance of web servers and applications. It sends HTTP requests to a target URL and displays real-time statistics in the terminal. You can control the number of requests, concurrent connections, request duration, and HTTP methods. It also provides response time statistics and different output formats.

Here’s what you can do with oha tool in Termux:

  • Test the performance of web servers.
  • Send multiple HTTP requests to a target URL.
  • Measure response times and request speed.
  • Test different HTTP methods.
  • Send request data using POST requests.
  • Test HTTP and HTTP/2 connections.
  • Save test results in JSON or CSV format.
  • View real-time testing statistics in the terminal.

Install oha in Termux

Below is the command to install oha in Termux using the Termux package manager. Simply copy and paste it into your Termux terminal.

First, update and upgrade the packages:

pkg update && pkg upgrade -y

Install oha:

pkg install oha -y

Once the installation is complete, check the installed version:

oha --version

oha is now ready to use.

Use oha in Termux

You can use the following commands to run HTTP tests and control different oha features in Termux.

Run a basic HTTP test:

oha https://example.com

Set the total number of requests:

oha -n 100 https://example.com

Set the number of concurrent connections:

oha -c 10 https://example.com

Run a test for a specific duration:

oha -z 30s https://example.com

Set the number of requests and connections:

oha -n 100 -c 10 https://example.com

Set the request rate per second:

oha -q 5 https://example.com

Use a specific HTTP method:

oha -m POST https://example.com

Add a custom HTTP header:

oha -H "User-Agent: TestClient" https://example.com

Send data with a POST request:

oha -m POST -d "name=test" https://example.com

Set a request timeout:

oha -t 10s https://example.com

Use HTTP/2:

oha --http2 https://example.com

Disable the real-time terminal interface:

oha --no-tui https://example.com

Save results in JSON format:

oha -o results.json --output-format json https://example.com

Save results in CSV format:

oha -o results.csv --output-format csv https://example.com

Read multiple URLs from a file:

oha --urls-from-file urls.txt

Perform a single request and display request and response details:

oha --debug https://example.com

Disable colored output:

oha --no-color https://example.com

Show the help menu:

oha --help

Show the installed version:

oha --version

These commands help you run HTTP tests and control how oha sends requests to a server.

End Note

oha is a simple tool for testing website performance in Termux. It provides different options to send HTTP requests, control connections, check response times, and view detailed test results. You can use it to explore different HTTP testing options and understand server response behavior.

SHARE THIS POST: