mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Expose reverse proxy API for dynamic mounts
PUBLISHED_FROM=00772400bce7c15368d91741092ebc8ab0842e19
This commit is contained in:
1 parent
900bbe724a
commit
a4c668e37a
4 files changed
+46
-3
No files matched your search
+16
@@ -3502,6 +3502,22 @@ void mg_send_head(struct mg_connection *n, int status_code,
|
||||
*/
|
||||
void mg_printf_html_escape(struct mg_connection *nc, const char *fmt, ...);
|
||||
|
||||
#if MG_ENABLE_HTTP_URL_REWRITES
|
||||
/*
|
||||
* Proxies a given request to a given upstream http server. The path prefix
|
||||
* in `mount` will be stripped of the path requested to the upstream server,
|
||||
* e.g. if mount is /api and upstream is http://localhost:8001/foo
|
||||
* then an incoming request to /api/bar will cause a request to
|
||||
* http://localhost:8001/foo/bar
|
||||
*
|
||||
* EXPERIMENTAL API. Please use http_serve_http + url_rewrites if a static
|
||||
* mapping is good enough.
|
||||
*/
|
||||
void mg_http_reverse_proxy(struct mg_connection *nc,
|
||||
const struct http_message *hm, struct mg_str mount,
|
||||
struct mg_str upstream);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Reference in new issue
Block a user