dpp::http_server
dpp::socket_listener< http_server_request >
dpp::discord_webhook_server
http_server.h
uint16_t uint16_t dpp::http_server::bound_port bound_port dpp::http_server::bound_port

Port we are listening on.

event_handle event_handle dpp::socket_listener< http_server_request, typename >::close_event close_event dpp::socket_listener< http_server_request >::close_event

Event to handle socket removal from the connection map.

std::unordered_map< socket, std::unique_ptr< http_server_request > > std::unordered_map<socket, std::unique_ptr<http_server_request> > dpp::socket_listener< http_server_request, typename >::connections connections dpp::socket_listener< http_server_request >::connections

Active connections for the server of type T.

cluster * cluster* dpp::socket_listener< http_server_request, typename >::creator creator dpp::socket_listener< http_server_request >::creator

Cluster creator.

socket_events socket_events dpp::socket_listener< http_server_request, typename >::events events dpp::socket_listener< http_server_request >::events

Socket events for listen socket in the socket engine.

raii_socket raii_socket dpp::socket_listener< http_server_request, typename >::fd fd dpp::socket_listener< http_server_request >::fd

The listening socket for incoming connections.

bool bool dpp::socket_listener< http_server_request, typename >::plaintext plaintext dpp::socket_listener< http_server_request >::plaintext

True if plain text connections to the server are allowed.

std::string std::string dpp::socket_listener< http_server_request, typename >::private_key_file private_key_file dpp::socket_listener< http_server_request >::private_key_file

Private key PEM file path, if running an SSL server.

std::string std::string dpp::socket_listener< http_server_request, typename >::public_key_file public_key_file dpp::socket_listener< http_server_request >::public_key_file

Public key PEM file path, if running an SSL server.

http_server_request_event http_server_request_event dpp::http_server::request_handler request_handler dpp::http_server::request_handler

Request handler callback to use for all incoming HTTP(S) requests.

dpp::http_server::http_server
(cluster *creator, const std::string_view address, uint16_t port, http_server_request_event handle_request, const std::string &private_key="", const std::string &public_key="")
http_server
dpp::http_server::http_server
cluster * creator
const std::string_view address
uint16_t port
http_server_request_event handle_request
const std::string & private_key ""
const std::string & public_key ""

Constructor for creation of a HTTP(S) server.

creator

Cluster creator

address

address to bind to, use "0.0.0.0" to bind to all local addresses

port

port to bind to. You should generally use a port > 1024.

handle_request

Callback to call for each pending request

private_key

Private key PEM file for HTTPS/SSL. If empty, a plaintext server is created

public_key

Public key PEM file for HTTPS/SSL. If empty, a plaintext server is created

virtual dpp::http_server::~http_server
()
~http_server
dpp::http_server::~http_server

Destructor.

void void dpp::http_server::emplace (socket newfd) override emplace dpp::http_server::emplace emplace socket newfd

Emplace a new request into the connection pool.

newfd

file descriptor of new request

void virtual void dpp::socket_listener< http_server_request, typename >::handle_accept (socket sfd, const struct socket_events &e) handle_accept dpp::socket_listener< http_server_request >::handle_accept socket sfd const struct socket_events & e

Handle a new incoming socket with accept() Accepts a new connection, and calls emplace() if valid.

sfd

File descriptor for listening socket

e

socket events for the listening socket

Creates a simple HTTP server which listens on a TCP port for a plaintext or SSL incoming request, and passes that request to a callback to generate the response.

dpp::discord_webhook_server
dpp::http_server
dpp::socket_listener< T, typename >
dpp::socket_listener< http_server_request >
< http_server_request >
K
T
bool
cache_policy_setting_t
double
dpp::cache_policy_t
channel_policy
emoji_policy
guild_policy
role_policy
user_policy
dpp::cluster
token
last_identify
cluster_id
intents
maxclusters
numshards
rest_ping
me
cache_policy
ws_mode
terminating
request_timeout
socketengine
on_voice_channel_effect_send
on_voice_state_update
on_voice_client_platform
on_voice_client_disconnect
on_voice_client_speaking
on_log
on_socket_close
on_guild_join_request_delete
on_interaction_create
on_slashcommand
on_button_click
on_autocomplete
on_select_click
on_message_context_menu
on_user_context_menu
on_form_submit
on_guild_delete
on_channel_delete
on_channel_update
on_ready
on_message_delete
on_guild_member_remove
on_resumed
on_guild_role_create
on_typing_start
on_message_reaction_add
on_guild_members_chunk
on_message_reaction_remove
on_guild_create
on_channel_create
on_message_reaction_remove_emoji
on_message_delete_bulk
on_guild_role_update
on_guild_role_delete
on_channel_pins_update
on_message_reaction_remove_all
on_voice_server_update
on_guild_emojis_update
on_guild_stickers_update
on_presence_update
on_webhooks_update
on_automod_rule_create
on_automod_rule_update
on_automod_rule_delete
on_automod_rule_execute
on_guild_member_add
on_invite_delete
on_guild_update
on_guild_integrations_update
on_guild_member_update
on_invite_create
on_message_update
on_user_update
on_message_create
on_message_poll_vote_add
on_message_poll_vote_remove
on_guild_audit_log_entry_create
on_guild_ban_add
on_guild_ban_remove
on_integration_create
on_integration_update
on_integration_delete
on_thread_create
on_thread_update
on_thread_delete
on_thread_list_sync
on_thread_member_update
on_thread_members_update
on_guild_scheduled_event_create
on_guild_scheduled_event_update
on_guild_scheduled_event_delete
on_guild_scheduled_event_user_add
on_guild_scheduled_event_user_remove
on_voice_buffer_send
on_voice_ready
on_voice_receive
on_voice_receive_combined
on_voice_track_marker
on_stage_instance_create
on_stage_instance_update
on_stage_instance_delete
on_entitlement_create
on_entitlement_update
on_entitlement_delete
dpp::event_router_t< T >
dpp::event_router_t< dpp::autocomplete_t >
< dpp::autocomplete_t >
dpp::event_router_t< dpp::automod_rule_create_t >
< dpp::automod_rule_create_t >
dpp::event_router_t< dpp::automod_rule_delete_t >
< dpp::automod_rule_delete_t >
dpp::event_router_t< dpp::automod_rule_execute_t >
< dpp::automod_rule_execute_t >
dpp::event_router_t< dpp::automod_rule_update_t >
< dpp::automod_rule_update_t >
dpp::event_router_t< dpp::button_click_t >
< dpp::button_click_t >
dpp::event_router_t< dpp::channel_create_t >
< dpp::channel_create_t >
dpp::event_router_t< dpp::channel_delete_t >
< dpp::channel_delete_t >
dpp::event_router_t< dpp::channel_pins_update_t >
< dpp::channel_pins_update_t >
dpp::event_router_t< dpp::channel_update_t >
< dpp::channel_update_t >
dpp::event_router_t< dpp::entitlement_create_t >
< dpp::entitlement_create_t >
dpp::event_router_t< dpp::entitlement_delete_t >
< dpp::entitlement_delete_t >
dpp::event_router_t< dpp::entitlement_update_t >
< dpp::entitlement_update_t >
dpp::event_router_t< dpp::form_submit_t >
< dpp::form_submit_t >
dpp::event_router_t< dpp::guild_audit_log_entry_create_t >
< dpp::guild_audit_log_entry_create_t >
dpp::event_router_t< dpp::guild_ban_add_t >
< dpp::guild_ban_add_t >
dpp::event_router_t< dpp::guild_ban_remove_t >
< dpp::guild_ban_remove_t >
dpp::event_router_t< dpp::guild_create_t >
< dpp::guild_create_t >
dpp::event_router_t< dpp::guild_delete_t >
< dpp::guild_delete_t >
dpp::event_router_t< dpp::guild_emojis_update_t >
< dpp::guild_emojis_update_t >
dpp::event_router_t< dpp::guild_integrations_update_t >
< dpp::guild_integrations_update_t >
dpp::event_router_t< dpp::guild_join_request_delete_t >
< dpp::guild_join_request_delete_t >
dpp::event_router_t< dpp::guild_member_add_t >
< dpp::guild_member_add_t >
dpp::event_router_t< dpp::guild_member_remove_t >
< dpp::guild_member_remove_t >
dpp::event_router_t< dpp::guild_member_update_t >
< dpp::guild_member_update_t >
dpp::event_router_t< dpp::guild_members_chunk_t >
< dpp::guild_members_chunk_t >
dpp::event_router_t< dpp::guild_role_create_t >
< dpp::guild_role_create_t >
dpp::event_router_t< dpp::guild_role_delete_t >
< dpp::guild_role_delete_t >
dpp::event_router_t< dpp::guild_role_update_t >
< dpp::guild_role_update_t >
dpp::event_router_t< dpp::guild_scheduled_event_create_t >
< dpp::guild_scheduled_event_create_t >
dpp::event_router_t< dpp::guild_scheduled_event_delete_t >
< dpp::guild_scheduled_event_delete_t >
dpp::event_router_t< dpp::guild_scheduled_event_update_t >
< dpp::guild_scheduled_event_update_t >
dpp::event_router_t< dpp::guild_scheduled_event_user_add_t >
< dpp::guild_scheduled_event_user_add_t >
dpp::event_router_t< dpp::guild_scheduled_event_user_remove_t >
< dpp::guild_scheduled_event_user_remove_t >
dpp::event_router_t< dpp::guild_stickers_update_t >
< dpp::guild_stickers_update_t >
dpp::event_router_t< dpp::guild_update_t >
< dpp::guild_update_t >
dpp::event_router_t< dpp::integration_create_t >
< dpp::integration_create_t >
dpp::event_router_t< dpp::integration_delete_t >
< dpp::integration_delete_t >
dpp::event_router_t< dpp::integration_update_t >
< dpp::integration_update_t >
dpp::event_router_t< dpp::interaction_create_t >
< dpp::interaction_create_t >
dpp::event_router_t< dpp::invite_create_t >
< dpp::invite_create_t >
dpp::event_router_t< dpp::invite_delete_t >
< dpp::invite_delete_t >
dpp::event_router_t< dpp::log_t >
< dpp::log_t >
dpp::event_router_t< dpp::message_context_menu_t >
< dpp::message_context_menu_t >
dpp::event_router_t< dpp::message_create_t >
< dpp::message_create_t >
dpp::event_router_t< dpp::message_delete_bulk_t >
< dpp::message_delete_bulk_t >
dpp::event_router_t< dpp::message_delete_t >
< dpp::message_delete_t >
dpp::event_router_t< dpp::message_poll_vote_add_t >
< dpp::message_poll_vote_add_t >
dpp::event_router_t< dpp::message_poll_vote_remove_t >
< dpp::message_poll_vote_remove_t >
dpp::event_router_t< dpp::message_reaction_add_t >
< dpp::message_reaction_add_t >
dpp::event_router_t< dpp::message_reaction_remove_all_t >
< dpp::message_reaction_remove_all_t >
dpp::event_router_t< dpp::message_reaction_remove_emoji_t >
< dpp::message_reaction_remove_emoji_t >
dpp::event_router_t< dpp::message_reaction_remove_t >
< dpp::message_reaction_remove_t >
dpp::event_router_t< dpp::message_update_t >
< dpp::message_update_t >
dpp::event_router_t< dpp::presence_update_t >
< dpp::presence_update_t >
dpp::event_router_t< dpp::ready_t >
< dpp::ready_t >
dpp::event_router_t< dpp::resumed_t >
< dpp::resumed_t >
dpp::event_router_t< dpp::select_click_t >
< dpp::select_click_t >
dpp::event_router_t< dpp::slashcommand_t >
< dpp::slashcommand_t >
dpp::event_router_t< dpp::socket_close_t >
< dpp::socket_close_t >
dpp::event_router_t< dpp::stage_instance_create_t >
< dpp::stage_instance_create_t >
dpp::event_router_t< dpp::stage_instance_delete_t >
< dpp::stage_instance_delete_t >
dpp::event_router_t< dpp::stage_instance_update_t >
< dpp::stage_instance_update_t >
dpp::event_router_t< dpp::thread_create_t >
< dpp::thread_create_t >
dpp::event_router_t< dpp::thread_delete_t >
< dpp::thread_delete_t >
dpp::event_router_t< dpp::thread_list_sync_t >
< dpp::thread_list_sync_t >
dpp::event_router_t< dpp::thread_member_update_t >
< dpp::thread_member_update_t >
dpp::event_router_t< dpp::thread_members_update_t >
< dpp::thread_members_update_t >
dpp::event_router_t< dpp::thread_update_t >
< dpp::thread_update_t >
dpp::event_router_t< dpp::typing_start_t >
< dpp::typing_start_t >
dpp::event_router_t< dpp::user_context_menu_t >
< dpp::user_context_menu_t >
dpp::event_router_t< dpp::user_update_t >
< dpp::user_update_t >
dpp::event_router_t< dpp::voice_buffer_send_t >
< dpp::voice_buffer_send_t >
dpp::event_router_t< dpp::voice_channel_effect_send_t >
< dpp::voice_channel_effect_send_t >
dpp::event_router_t< dpp::voice_client_disconnect_t >
< dpp::voice_client_disconnect_t >
dpp::event_router_t< dpp::voice_client_platform_t >
< dpp::voice_client_platform_t >
dpp::event_router_t< dpp::voice_client_speaking_t >
< dpp::voice_client_speaking_t >
dpp::event_router_t< dpp::voice_ready_t >
< dpp::voice_ready_t >
dpp::event_router_t< dpp::voice_receive_t >
< dpp::voice_receive_t >
dpp::event_router_t< dpp::voice_server_update_t >
< dpp::voice_server_update_t >
dpp::event_router_t< dpp::voice_state_update_t >
< dpp::voice_state_update_t >
dpp::event_router_t< dpp::voice_track_marker_t >
< dpp::voice_track_marker_t >
dpp::event_router_t< dpp::webhooks_update_t >
< dpp::webhooks_update_t >
dpp::http_server
request_handler
bound_port
dpp::http_server_request
path
request_type
state
status
timed_out
content_length
dpp::json_interface< T >
dpp::json_interface< user >
< user >
dpp::managed
id
dpp::raii_socket
fd
dpp::snowflake
value
dpp::socket_engine_base
owner
fds_mutex
fds
stats
dpp::socket_events
fd
flags
on_read
on_write
on_error
dpp::socket_listener< T, typename >
fd
connections
creator
plaintext
private_key_file
public_key_file
close_event
events
dpp::socket_listener< http_server_request >
fd
connections
creator
plaintext
private_key_file
public_key_file
close_event
events
< http_server_request >
dpp::socket_stats
active_fds
deletions
errors
iterations
reads
updates
writes
engine_type
dpp::ssl_connection
buffer
cipher
hostname
obuffer
port
private_key_file
public_key_file
sfd
ssl
last_tick
start
connect_retries
bytes_in
bytes_out
unique_id
connected
keepalive
plaintext
raw_trace
tcp_connect_done
timer_handle
owner
dpp::user
global_name
username
avatar
avatar_decoration
primary_guild
flags
discriminator
refcount
dpp::utility::iconhash
first
second
dpp::utility::primaryguild
id
enabled
tag
badge
http_state
int
openssl_connection *
size_t
socket
atomic_bool
std::basic_string< Char >
std::basic_string_view< Char >
function< void(class http_server_request *)>
function< void(dpp::socket fd, const struct socket_events &)>
function< void(dpp::socket fd, const struct socket_events &, int error_code)>
std::shared_mutex
std::string
std::string_view
std::unique_ptr< T >
ptr
std::unique_ptr< dpp::socket_engine_base >
ptr
< dpp::socket_engine_base >
std::unique_ptr< http_server_request >
ptr
< http_server_request >
std::unordered_map< K, T >
keys
elements
std::unordered_map< dpp::socket, std::unique_ptr< socket_events > >
< dpp::socket, std::unique_ptr< socket_events > >
std::unordered_map< socket, std::unique_ptr< T > >
keys
elements
< socket, std::unique_ptr< T > >
std::unordered_map< socket, std::unique_ptr< http_server_request > >
keys
elements
< socket, std::unique_ptr< http_server_request > >
time_t
uint16_t
uint32_t
uint64_t
uint8_t
websocket_protocol_t
- dpp::http_server
  bound_port
- dpp::http_server
  close_event
- dpp::http_server
  connections
- dpp::http_server
  creator
- dpp::http_server
  emplace
- dpp::http_server
  events
- dpp::http_server
  fd
- dpp::http_server
  handle_accept
- dpp::http_server
  http_server
- dpp::http_server
  plaintext
- dpp::http_server
  private_key_file
- dpp::http_server
  public_key_file
- dpp::http_server
  request_handler
- dpp::http_server
  socket_listener
- dpp::http_server
  ~http_server
- dpp::http_server
  ~socket_listener