Add request type(/m3u) for Vu+PlayerHD (IOS).
[vuplus_transtreamproxy] / src / Http.h
1 /*
2  * Http.h
3  *
4  *  Created on: 2014. 6. 18.
5  *      Author: oskwon
6  */
7
8 #ifndef HTTP_H_
9 #define HTTP_H_
10
11 #include <map>
12 #include <string>
13
14 #include "Mpeg.h"
15 //----------------------------------------------------------------------
16
17 class HttpHeader
18 {
19 public:
20         enum {
21                 UNKNOWN = 0,
22                 TRANSCODING_LIVE,
23                 TRANSCODING_FILE,
24                 M3U
25         };
26
27         int type;
28         std::string method;
29         std::string path;
30         std::string version;
31         std::map<std::string, std::string> params;
32
33         std::string page;
34         std::map<std::string, std::string> page_params;
35
36 private:
37
38 public:
39         HttpHeader() : type(UNKNOWN) {}
40         virtual ~HttpHeader() {}
41
42         bool parse_request(std::string header);
43         std::string build_response(Mpeg *source);
44
45         static std::string read_request();
46 };
47 //----------------------------------------------------------------------
48
49 #endif /* HTTP_H_ */