Socket tester
This is a simple TCP client in Golang that can connect to a host and send a message over the TCP protocol. The client also supports the use of Proxy Protocol v2.
Installation
To use this program, you must have Go installed on your computer.
Clone the repository from GitHub:
git clone https://github.com/devbay-io/socket_tester.git
Usage
You can use official github releases which are located here.
To run the program from source, use the following command:
go run cmd/socket_tester/main.go -host=<host> -port=<port> -message=<message>
where <host>
is the host you want to connect to, <port>
is the port number to use, and <message>
is the message you want to send to the server.
You can also use the following optional flags:
-proxyProtocol
- Set this flag if you want to use Proxy Protocol v2
-customTimeoutMillis
- Set the number of milliseconds before timing out the socket client
-sslEnabled
- Use ssl connection
-help
- Show the help menu
For example, to connect to localhost on port 1234 and send the message "Hello, world!" with a custom timeout of 500 milliseconds, use the following command:
go run main.go -host=localhost -port=1234 -message="Hello, world!" -customTimeoutMillis=500
License
This project is licensed under the MIT License. See the LICENSE file for details.
Please be aware that any library used by this project might have its own license!
Credits
This program uses the go-proxyproto package by pires.
This readme was generated by ChatGPT