muratovdias / test-proxy-server

HTTP server for proxying HTTP-requests to 3rd-party services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reverse Proxy Server

About

  • HTTP server for proxying HTTP-requests to 3rd-party services. The server is waiting HTTP-request from client (curl, for example). In request's body there should be message in JSON format. For example:
{
    "method": "GET",
    "url": "http://google.com",
    "headers": {
        "Authentication": "Basic bG9naW46cGFzc3dvcmQ=",
        ....
    }
}
  • Server forms valid HTTP-request to 3rd-party service with data from client's message and responses to client with JSON object:
{
    "id": <generated unique id>,
    "status": <HTTP status of 3rd-party service response>,
    "headers": {
        <headers array from 3rd-party service response>
    },
    "length": <content length of 3rd-party service response>
}
  • Also server have map to store requests from client and responses from 3rd-party service.

Usage

$ make run

About

HTTP server for proxying HTTP-requests to 3rd-party services.


Languages

Language:Go 99.7%Language:Makefile 0.3%