myMPD
Internal API documentation
Loading...
Searching...
No Matches
request_handler.h File Reference

HTTP request handler. More...

#include "dist/mongoose/mongoose.h"
#include "src/webserver/mg_user_data.h"
Include dependency graph for request_handler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool request_handler_api (struct mg_connection *nc, sds body, struct mg_str *auth_header, struct t_mg_user_data *mg_user_data)
bool request_handler_script_api (struct mg_connection *nc, sds body)
void request_handler_browse (struct mg_connection *nc, struct mg_http_message *hm, struct t_mg_user_data *mg_user_data)
void request_handler_proxy (struct mg_connection *nc, struct mg_http_message *hm, struct mg_connection *backend_nc)
void request_handler_proxy_covercache (struct mg_connection *nc, struct mg_http_message *hm, struct mg_connection *backend_nc)
void request_handler_serverinfo (struct mg_connection *nc)
void request_handler_ca (struct mg_connection *nc, struct mg_http_message *hm, struct t_mg_user_data *mg_user_data)
void request_handler_extm3u (struct mg_connection *nc, struct mg_http_message *hm, struct t_mg_user_data *mg_user_data)

Detailed Description

HTTP request handler.

Function Documentation

◆ request_handler_api()

bool request_handler_api ( struct mg_connection * nc,
sds body,
struct mg_str * auth_header,
struct t_mg_user_data * mg_user_data )

Request handler for api requests /api

Parameters
ncmongoose connection
bodyhttp body (jsonrpc request)
auth_headerAuthentication header (myMPD session)
mg_user_datawebserver configuration
Returns
true on success, else false

◆ request_handler_browse()

void request_handler_browse ( struct mg_connection * nc,
struct mg_http_message * hm,
struct t_mg_user_data * mg_user_data )

Request handler for /browse

Parameters
ncmongoose connection
hmhttp message
mg_user_datawebserver configuration

◆ request_handler_ca()

void request_handler_ca ( struct mg_connection * nc,
struct mg_http_message * hm,
struct t_mg_user_data * mg_user_data )

Request handler for /ca.crt

Parameters
ncmongoose connection
hmhttp message
mg_user_datawebserver configuration

◆ request_handler_extm3u()

void request_handler_extm3u ( struct mg_connection * nc,
struct mg_http_message * hm,
struct t_mg_user_data * mg_user_data )

Request handler for /webradio to retrieve an extm3u for a webradio. Sends the request to the mympd_api thread.

Parameters
ncmongoose connection
hmhttp message
mg_user_datawebserver configuration

◆ request_handler_proxy()

void request_handler_proxy ( struct mg_connection * nc,
struct mg_http_message * hm,
struct mg_connection * backend_nc )

Request handler for proxy connections /proxy

Parameters
ncmongoose connection
hmhttp body
backend_ncmongoose backend connection

◆ request_handler_proxy_covercache()

void request_handler_proxy_covercache ( struct mg_connection * nc,
struct mg_http_message * hm,
struct mg_connection * backend_nc )

Request handler for proxy connections /proxy-covercache

Parameters
ncmongoose connection
hmhttp body
backend_ncmongoose backend connection

◆ request_handler_script_api()

bool request_handler_script_api ( struct mg_connection * nc,
sds body )

Request handler for script api requests /api/script

Parameters
ncmongoose connection
bodyhttp body (jsonrpc request)
Returns
true on success, else false

◆ request_handler_serverinfo()

void request_handler_serverinfo ( struct mg_connection * nc)

Request handler for /serverinfo

Parameters
ncmongoose connection