libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] [Q] question about using POST in proxy mode


From: Christian Grothoff
Subject: Re: [libmicrohttpd] [Q] question about using POST in proxy mode
Date: Tue, 30 Apr 2013 11:18:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Dear Tawan,

To parse the incoming POST, you should use the MHD_PostProcessor API.
The recently added 'demo.c' example demonstrates how to use it extensively. (Note that this code is so far not in the release version;
you can find it in SVN HEAD under src/examples/.)

Happy hacking!

Christian

On 04/30/2013 10:02 AM, Tawan Won wrote:
Hi,

I am trying to make a HTTP proxy using libmicrohttpd which plays a
caching/proxy role between clients and an origin web server.

As of date, I almostly finished GET processing. For handling POST
request, I am confused in using libmicrohttpd API.

I want my proxy server relays incoming POST requests to the origin
server without inspecting the message body.

For POST, what I want is

(1)Parse incoming POSTs ; headers(key/value pairs) + message body (raw
bytes stream)

(2)Create a request message for origin

(3)Add request’s headers and my own headers to the request

(4)Add the message body to the request

(5)Send the request to the orgin

(6)Receive the response from the origin

(7)Create a response for the client

(8)Add the origin’s response to the response for client.

(9)Send the response to the client

So far, I could not found a proper API from libmicrohttpd for stage (1)

Any help will be highly appreciated!

Thanks in advance.

-----------------

Tawan Won




reply via email to

[Prev in Thread] Current Thread [Next in Thread]