Skip to content

A lightweight tool built with Go to test the accessibility of multiple ports across various servers.

License

Notifications You must be signed in to change notification settings

grayspec/go-port-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-port-tester

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.


Features

  • 🌐 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.

Table of Contents


Requirements

  • Go (version 1.20 or higher)
  • GNU Make

Installation

Installing Go

  • 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

Installing Make

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

Build Instructions

To build the application, use the provided Makefile for cross-platform compatibility.

  1. Clone the Repository:

    git clone https://github.com/your-username/go-port-tester.git
    cd go-port-tester
  2. Build for all platforms:

    make all
  3. Platform-Specific Builds:

    • Windows:
      make build-windows
    • macOS:
      make build-macos
    • Linux:
      make build-linux

The built binaries will be located in the build directory, organized by OS.


Running the Application

Server (Test Subject)

The server component will host a simple HTTP service on specified ports for testing purposes.

./build/<platform>/server --config server.csv

Client (Port Tester)

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

Usage Examples

Sample CSV for Servers (servers.csv):

IP,Port
127.0.0.1,8080
192.168.1.10,8081