-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.def.h
53 lines (46 loc) · 1.67 KB
/
config.def.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#define MAXFDS 128
#define KEEP_ALIVE_TIMEOUT 5 /* in seconds */
#define DEFAULT_CONF_PORT 7887
#define DEFAULT_CONF_KEEP_ALIVE 0
#define DEFAULT_CONF_QUIET 0
#define DEFAULT_CONF_CHROOT 0
#define DEFAULT_CONF_LISTEN_ADDR "127.0.0.1"
#define DEFAULT_CONF_ROOT_DIR "."
#define INDEX_PAGE "index.html"
#define DEFAULT_MIMETYPE "application/octet-stream"
#define INDEX_MIMETYPE "text/html; charset=utf-8"
#define HTTP_STATUS_FORMAT "<h1>%s</h1>" // <h1>Not Found</h1>
/* mime-types */
static const struct {
char *ext;
char *type;
} mimes[] = {
{ "xml", "application/xml; charset=utf-8" },
{ "xhtml", "application/xhtml+xml; charset=utf-8" },
{ "html", "text/html; charset=utf-8" },
{ "htm", "text/html; charset=utf-8" },
{ "css", "text/css; charset=utf-8" },
{ "txt", "text/plain; charset=utf-8" },
{ "vtt", "text/plain; charset=utf-8" },
{ "md", "text/plain; charset=utf-8" },
{ "c", "text/plain; charset=utf-8" },
{ "h", "text/plain; charset=utf-8" },
{ "log", "text/plain; charset=utf-8" },
{ "py", "text/plain; charset=utf-8" },
{ "gz", "application/x-gtar" },
{ "tar", "application/tar" },
{ "pdf", "application/pdf" },
{ "png", "image/png" },
{ "gif", "image/gif" },
{ "jpeg", "image/jpg" },
{ "jpg", "image/jpg" },
{ "iso", "application/x-iso9660-image" },
{ "webp", "image/webp" },
{ "svg", "image/svg+xml; charset=utf-8" },
{ "flac", "audio/flac" },
{ "mp3", "audio/mpeg" },
{ "ogg", "audio/ogg" },
{ "mp4", "video/mp4" },
{ "ogv", "video/ogg" },
{ "webm", "video/webm" },
};