0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-19 07:21:45 +00:00
netdata_netdata/web/server/web_server.h
Costa Tsaousis c3d70ffcb4
WEBRTC for communication between agents and browsers ()
* initial webrtc setup

* missing files

* rewrite of webrtc integration

* initialization and cleanup of webrtc connections

* make it compile without libdatachannel

* add missing webrtc_initialize() function when webrtc is not enabled

* make c++17 optional

* add build/m4/ax_compiler_vendor.m4

* add ax_cxx_compile_stdcxx.m4

* added new m4 files to makefile.am

* id all webrtc connections

* show warning when webrtc is disabled

* fixed message

* moved all webrtc error checking inside webrtc.cpp

* working webrtc connection establishment and cleanup

* remove obsolete code

* rewrote webrtc code in C to remove dependency for c++17

* fixed left-over reference

* detect binary and text messages

* minor fix

* naming of webrtc threads

* added webrtc configuration

* fix for thread_get_name_np()

* smaller web_client memory footprint

* universal web clients cache

* free web clients every 100 uses

* webrtc is now enabled by default only when compiled with internal checks

* webrtc responses to /api/ requests, including LZ4 compression

* fix for binary and text messages

* web_client_cache is now global

* unification of the internal web server API, for web requests, aclk request, webrtc requests

* more cleanup and unification of web client timings

* fixed compiler warnings

* update sent and received bytes

* eliminated of almost all big buffers in web client

* registry now uses the new json generation

* cookies are now an array; fixed redirects

* fix redirects, again

* write cookies directly to the header buffer, eliminating the need for cookie structures in web client

* reset the has_cookies flag

* gathered all web client cleanup to one function

* fixes redirects

* added summary.globals in /api/v2/data response

* ars to arc in /api/v2/data

* properly handle host impersonation

* set the context of mem.numa_nodes
2023-04-20 20:49:06 +03:00

63 lines
1.9 KiB
C

// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef NETDATA_WEB_SERVER_H
#define NETDATA_WEB_SERVER_H 1
#include "libnetdata/libnetdata.h"
#include "web_client.h"
#ifndef API_LISTEN_PORT
#define API_LISTEN_PORT 19999
#endif
#ifndef API_LISTEN_BACKLOG
#define API_LISTEN_BACKLOG 4096
#endif
typedef enum web_server_mode {
WEB_SERVER_MODE_STATIC_THREADED,
WEB_SERVER_MODE_NONE
} WEB_SERVER_MODE;
extern SIMPLE_PATTERN *web_allow_connections_from;
extern int web_allow_connections_dns;
extern SIMPLE_PATTERN *web_allow_dashboard_from;
extern int web_allow_dashboard_dns;
extern SIMPLE_PATTERN *web_allow_registry_from;
extern int web_allow_registry_dns;
extern SIMPLE_PATTERN *web_allow_badges_from;
extern int web_allow_badges_dns;
extern SIMPLE_PATTERN *web_allow_streaming_from;
extern int web_allow_streaming_dns;
extern SIMPLE_PATTERN *web_allow_netdataconf_from;
extern int web_allow_netdataconf_dns;
extern SIMPLE_PATTERN *web_allow_mgmt_from;
extern int web_allow_mgmt_dns;
extern WEB_SERVER_MODE web_server_mode;
WEB_SERVER_MODE web_server_mode_id(const char *mode);
const char *web_server_mode_name(WEB_SERVER_MODE id);
void api_listen_sockets_setup(void);
#define DEFAULT_TIMEOUT_TO_RECEIVE_FIRST_WEB_REQUEST 60
#define DEFAULT_DISCONNECT_IDLE_WEB_CLIENTS_AFTER_SECONDS 60
extern int web_client_timeout;
extern int web_client_first_request_timeout;
extern long web_client_streaming_rate_t;
#ifdef WEB_SERVER_INTERNALS
extern LISTEN_SOCKETS api_sockets;
void web_client_update_acl_matches(struct web_client *w);
void web_server_log_connection(struct web_client *w, const char *msg);
struct web_client *web_client_create_on_listenfd(int listener);
#include "web_client_cache.h"
#endif // WEB_SERVER_INTERNALS
#include "static/static-threaded.h"
#include "daemon/common.h"
#endif /* NETDATA_WEB_SERVER_H */