HTTP proxy functions.
More...
◆ create_backend_connection()
struct mg_connection * create_backend_connection |
( |
struct mg_connection * |
nc, |
|
|
struct mg_connection * |
backend_nc, |
|
|
sds |
uri, |
|
|
mg_event_handler_t |
fn, |
|
|
bool |
stream |
|
) |
| |
Creates the backend connection
- Parameters
-
nc | mongoose frontend connection |
backend_nc | pointer to use for backend connection |
uri | uri to connection |
fn | event handler function |
stream | is the backend connection a stream? |
- Returns
- backend connection on success, else NULL
◆ forward_backend_to_frontend_covercache()
void forward_backend_to_frontend_covercache |
( |
struct mg_connection * |
nc, |
|
|
int |
ev, |
|
|
void * |
ev_data |
|
) |
| |
Gets images from the backend, caches and forwards the response
- Parameters
-
nc | mongoose backend connection |
ev | mongoose event |
ev_data | mongoose ev_data (not used) |
◆ forward_backend_to_frontend_stream()
void forward_backend_to_frontend_stream |
( |
struct mg_connection * |
nc, |
|
|
int |
ev, |
|
|
void * |
ev_data |
|
) |
| |
Send the request to the backend and forwards the raw data from backend response to frontend connection
- Parameters
-
nc | mongoose backend connection |
ev | mongoose event |
ev_data | mongoose ev_data (not used) |
◆ free_backend_nc_data()
Frees the backend data struct
- Parameters
-
◆ handle_backend_close()
void handle_backend_close |
( |
struct mg_connection * |
nc | ) |
|
Handles the connection close on backend side
- Parameters
-
◆ is_allowed_proxy_uri()
bool is_allowed_proxy_uri |
( |
const char * |
uri | ) |
|
Public functions Checks if uri is in proxy whitelist
- Parameters
-
- Returns
- true if allowed, else false
◆ send_backend_request()
void send_backend_request |
( |
struct mg_connection * |
nc | ) |
|
Sends the request to the backend connection
- Parameters
-
nc | mongoose backend connection |
◆ allowed_proxy_hosts
const char* allowed_proxy_hosts[] |
|
static |
Initial value:= {
"jcorporation.github.io",
"raw.githubusercontent.com",
"musicbrainz.org",
"listenbrainz.org",
NULL
}
Private definitions