mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
Added enable_proxy
This commit is contained in:
1 parent
665f205527
commit
e0b9e4abfd
1 file changed
+6
-2
+6
-2
@@ -1196,6 +1196,7 @@ enum {
|
|||||||
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
|
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
|
||||||
ENABLE_DIRECTORY_LISTING,
|
ENABLE_DIRECTORY_LISTING,
|
||||||
#endif
|
#endif
|
||||||
|
ENABLE_PROXY,
|
||||||
#endif
|
#endif
|
||||||
EXTRA_MIME_TYPES,
|
EXTRA_MIME_TYPES,
|
||||||
#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH)
|
#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH)
|
||||||
@@ -1238,6 +1239,7 @@ static const char *static_config_options[] = {
|
|||||||
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
|
#ifndef MONGOOSE_NO_DIRECTORY_LISTING
|
||||||
"enable_directory_listing", "yes",
|
"enable_directory_listing", "yes",
|
||||||
#endif
|
#endif
|
||||||
|
"enable_proxy", NULL,
|
||||||
#endif
|
#endif
|
||||||
"extra_mime_types", NULL,
|
"extra_mime_types", NULL,
|
||||||
#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH)
|
#if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH)
|
||||||
@@ -4198,6 +4200,7 @@ static void open_local_endpoint(struct connection *conn, int skip_user) {
|
|||||||
file_stat_t st;
|
file_stat_t st;
|
||||||
int exists = 0;
|
int exists = 0;
|
||||||
#endif
|
#endif
|
||||||
|
const char *pxy = conn->server->config_options[ENABLE_PROXY];
|
||||||
|
|
||||||
// If EP_USER was set in a prev call, reset it
|
// If EP_USER was set in a prev call, reset it
|
||||||
conn->endpoint_type = EP_NONE;
|
conn->endpoint_type = EP_NONE;
|
||||||
@@ -4226,8 +4229,9 @@ static void open_local_endpoint(struct connection *conn, int skip_user) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(conn->mg_conn.request_method, "CONNECT") == 0 ||
|
if (pxy != NULL && !strcmp(pxy, "yes") &&
|
||||||
memcmp(conn->mg_conn.uri, "http", 4) == 0) {
|
(strcmp(conn->mg_conn.request_method, "CONNECT") == 0 ||
|
||||||
|
memcmp(conn->mg_conn.uri, "http", 4) == 0)) {
|
||||||
proxify_connection(conn);
|
proxify_connection(conn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user