go-port-tester
is a simple Go project designed to test the status of specified ports on multiple servers by making HTTP requests.
This project is helpful for network administrators or developers who need to verify the accessibility of various services running on different servers and ports.
This project is licensed under the MIT License - see the LICENSE file for details.
- 🌐 Multi-Server, Multi-Port Checks: Test multiple IPs and ports simultaneously.
- ⚡ Fast & Concurrent: Adjustable concurrency for faster testing, optimized for large networks.
- 📊 Easy Results: Save results in a clean CSV format, ready for analysis.
- 🛠️ Cross-Platform Compatibility: Build and run on Windows, macOS, and Linux.
- Go (version 1.20 or higher)
- GNU Make
- Windows: Download and install Go from the official Go website.
- macOS: Use Homebrew to install:
brew install go
- Linux: Follow the instructions on the official Go website or use a package manager like
apt
:sudo apt update sudo apt install -y golang
Make is typically pre-installed on Linux and macOS. For Windows, follow these steps:
-
Windows: Install Make via Chocolatey:
choco install make
or install via Scoop:
scoop install make
-
macOS: Install with Homebrew:
brew install make
-
Linux: Make is commonly pre-installed. To install, run:
sudo apt install -y make
To build the application, use the provided Makefile
for cross-platform compatibility.
-
Clone the Repository:
git clone https://github.com/your-username/go-port-tester.git cd go-port-tester
-
Build for all platforms:
make all
-
Platform-Specific Builds:
- Windows:
make build-windows
- macOS:
make build-macos
- Linux:
make build-linux
- Windows:
The built binaries will be located in the build
directory, organized by OS.
The server component will host a simple HTTP service on specified ports for testing purposes.
./build/<platform>/server --config server.csv
The client component will send requests to specified IP and port combinations to check their status.
./build/<platform>/client --servers servers.csv --output result.csv --timeout 2 --concurrency 5
Sample CSV for Servers (servers.csv
):
IP,Port
127.0.0.1,8080
192.168.1.10,8081