A simple proxy server implemented in Golang that allows you to route incoming traffic to a specified destination server based on the provided URL and port.
- Basic TCP proxy server that forwards traffic to a destination server.
- Customizable proxy server address and port.
- Easy-to-use for routing traffic from a client to a specified destination.
Railway |
---|
Before you begin, ensure you have a Go development environment set up.
-
Clone the repository:
git clone https://github.com/maxxfrazer/golang-proxy-server.git cd golang-proxy-server
-
Build the project:
go build cmd/main.go
-
Run the proxy server:
./main
The proxy server will start listening on localhost:8080 by default. You can customize the address and port in the main.go file.
-
Connect to the proxy server from a client application (e.g., telnet or netcat) and send a request with the target URL and port you want to access. For example:
echo "GET http://example.com:80 HTTP/1.1" | nc localhost 8080
This command sends an HTTP request to your proxy server, asking it to connect to
example.com
on port 80. -
The proxy server will forward the request to the target server (example.com) and return the response to the client.
You can customize the proxy server's behavior and settings by modifying the main.go
file. For example, you can change the proxy server's listening address and port, add authentication, or implement error handling and logging as needed.
Contributions are welcome! If you'd like to contribute to this project, please fork the repository and create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.