Simple Fiber Proxy Server
This is a basic Go application using the Fiber framework to create a proxy server. The server listens on port 3000 and has a single route (GET /proxy) that accepts a ?url=<target> query parameter, fetches data from the given external URL, and forwards it to the client.
How to Run
- Clone the repository.
- Navigate to the project directory.
- Run
go run main.go. - Use a tool like
curlto test it:curl "http://localhost:3000/proxy?url=https://dummyjson.com/products/1"
What It Does
- Fetches data from an external service, in this case
DummyJson.com - Forwards the fetched data or an error message to the client.
Error Handling
- Returns a 500 Internal Server Error if any issue occurs during the fetch.
- Returns the same status code as the external service if it's not a 200 OK.