ASP.NET
This project implements a simple HTTP server in ASP.NET to proxy requests to third-party services.
The server accepts HTTP requests from clients, extracts data from them, sends requests to third-party services, receives their responses, and returns the result to the client in JSON format. Requests and responses are stored locally in memory.
The server expects a request in JSON format with the fields:
{
"method": "GET",
"url": "http://example.com",
"headers": { "Authorization": "Bearer your_access_token" }
}
The response to the client must be in JSON format with the following fields:
{
"id": "requestId",
"status": <HTTP-статус ответа стороннего сервиса>,
"headers": { "массив заголовков из ответа стороннего сервиса" },
"length": <длина содержимого ответа>
}
git clone <URL репозитория>
cd ProxyServer
dotnet build
dotnet run
The server will be launched at http://localhost:44331.
To use the server, send a POST request to http://localhost:44331/Proxy/proxy with a JSON body containing the method, URL, and request headers:
{
"method": "GET",
"url": "http://example.com",
"headers": {
"Authorization": "Bearer your_access_token"
}
The server will send a request to the specified URL, receive a response from the third-party service, and return a JSON response with information about the request and response.
You can also run the server in a Docker container.
docker-compose build
docker-compose up -d
The server will be available at http://localhost:8080.
To automate commands, use Makefile.
make build
make run
make stop
https://proxy-server-zro1.onrender.com/Proxy/proxy
More information about the project can be found on the Wiki.
This project is licensed under the MIT License. See the LICENSE file for details.