Connectivity Tester is a tool for managing and testing server connections. It allows you to add servers to a database and perform connectivity tests on them. This tool was used to collect connectivity data for measuring shadowsocks blocking from various countries vantage points:
- Add servers to a database from a file
- Test connectivity of all servers or selectively retest based on previous errors
- Support for both TCP and UDP testing
- Go 1.17 or higher
- PostgreSQL database
- Clone the repository:
git clone https://github.com/yourusername/connectivity-tester.git
- Navigate to the project directory:
cd connectivity-tester
- Install dependencies:
go mod tidy
Create a config.yaml
file in the project root with the following structure:
database:
host: localhost
port: 5432
user: your_username
password: your_password
dbname: your_database_name
sslmode: disable
ipinfo:
token: your_ipinfo_token
connectivity:
resolver: 8.8.8.8
domain: example.com
To add servers from a file:
go run main.go add-servers path/to/your/file.txt
-
To test all servers:
go run main.go test-servers
-
To retest only servers with TCP errors (excluding 'connect' errors):
go run main.go test-servers --tcp
-
To retest only servers with UDP errors:
go run main.go test-servers --udp
-
To retest servers with either TCP or UDP errors:
go run main.go test-servers --tcp --udp
To enable debug logging, add the -d
or --debug
flag to any command:
go run main.go -d test-servers
Apache 2.0
Feel free to open a PR if you want to add a feature or report a bug fix