Hi Frédéric,
On Fri, Mar 29, 2013 at 1:10 AM, Frédéric Logier <
fre...@gmail.com> wrote:
> Hi,
> I'm trying zerogw as an HTTP API server. So, I need to push some binary data
> with specific headers like this :
>
> curl -H "X-node-uuid: 2d0a7780-e8fe-4e0a-89c6-a5a2737b095a" -H
> "X-payload-filename: filename" -H "X-payload-type: filetype" -X POST
> --data-binary @myfile
http://10.8.0.1:8000/echo
>
> Is there a way to get from the zeromq worker these headers ?
Yes. You should have something like the following in config:
zmq-forward:
enabled: yes
socket: !zmq.Req
- !zmq.Bind "ipc:///whatever/socket"
contents:
- !Uri
- !Header X-payload-type
- !Header X-payload-filename
- !Header X-node-uuid
- !Body
> and is it
> possible to set a max data lengh ? because zerogw return this error :
> 2013-03-29 00:04:14 [WARN] http.c:380: Request size too big
> I need to post data between 5ko to 200Mo.
>
Yes you can. The config follows:
Routing:
limits:
max-body-size: 200Mi
The limits are per route. You can write "limit" mapping at the same
level as "zmq-forward", to have bigger request limit only on certain
urls. "Mi" refer to Mebibytes (2**20), comparing to 1M which would be
1 million.
Note, request body is kept in memory until reply is fully sent, and no
streaming is performed.
You should probably limit number of simultaneous requests, to feel
safer from DoS attacks:
Server:
max-requests: 100
You are probably the first user who processes big file uploads, so
feel free to report any problems you have.
--
Paul