Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendation for a HTTP parsing library in C/C++ [closed]

Tags:

c++

c

http

I am looking for HTTP parsing library for C/C++. I have looked curl library, but it seems it is a http client library. I am looking for a library which parses HTTP header (e.g. a way to get the query string, get cookie, get request url, get Post Data)?

Thank you.

like image 310
michael Avatar asked Apr 11 '10 15:04

michael


2 Answers

About 6 months ago, I was looking for the same exact thing. Then I found this page: HTTP Made Really Really Easy and I just wrote my own... Works great, surprisingly simple to implement...

like image 191
dicroce Avatar answered Nov 04 '22 21:11

dicroce


Check out libebb, it has a parser generated with Ragel using the easy yet powerful PEG (it's based on Zed Shaw's mongrel parser)

libebb is a lightweight HTTP server library for C. It lays the foundation for writing a web server by providing the socket juggling and request parsing. By implementing the HTTP/1.1 grammar provided in RFC2612, libebb understands most most valid HTTP/1.1 connections (persistent, pipelined, and chunked requests included) and rejects invalid or malicious requests. libebb supports SSL over HTTP.

Also check this speedy parser

like image 13
clyfe Avatar answered Nov 04 '22 21:11

clyfe