https://github.com/vitorsv1/go-proxy
Acts as a middleman between the client and the internet, logging HTTP requests
https://github.com/vitorsv1/go-proxy
go http proxy requests
Last synced: about 1 year ago
JSON representation
Acts as a middleman between the client and the internet, logging HTTP requests
- Host: GitHub
- URL: https://github.com/vitorsv1/go-proxy
- Owner: vitorsv1
- Created: 2025-03-18T21:20:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-18T22:05:28.000Z (about 1 year ago)
- Last Synced: 2025-03-18T22:27:54.105Z (about 1 year ago)
- Topics: go, http, proxy, requests
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTTP Proxy with Logging
## Overview
This is a **basic HTTP proxy server** written in Go that logs all incoming HTTP requests. It captures essential details like the request method, URL, and headers, making it a useful starting point for learning about **networking, proxying, and logging in Go**.
## Features
- Forwards HTTP requests to their destination.
- Logs request details (method, URL, headers).
- Simple and lightweight, perfect for beginners.
## Installation & Usage
### Prerequisites
Ensure you have **Go installed** (version 1.18 or higher recommended). You can download it from [golang.org](https://golang.org/dl/).
### Clone the Repository
```sh
git clone https://github.com/vitorsv1/go-proxy.git
cd go-proxy
```
### Run the Proxy Server
```sh
go run main.go
```
By default, the proxy listens on **port 8080**.
### Configure Your System to Use the Proxy
- **Browser:** Set `localhost:8080` as your HTTP proxy.
- **Curl:** Use the proxy in requests:
```sh
curl -x http://localhost:8080 http://example.com
```
## File Structure
- cmd/
- main.go
- internal/
- proxy/
- proxy.go
- logger.go
- filter.go
- config/
- config.go
- logs/
- tests/
- go.mod
- README.md
## Next Steps
Here are some enhancements you can add:
- Support for **HTTPS requests**
- Implement **domain blocklisting**
- Save logs to a **file** instead of printing to the console