20module AP_MODULE_DECLARE_DATA proxy_wstunnel_module;
32 &proxy_wstunnel_module);
64 &proxy_wstunnel_module);
134 "To be forwarded path contains control "
135 "characters or spaces");
140 "To be forwarded query string contains control "
141 "characters or spaces");
168 char *
url,
char *server_portstr)
182 char *old_cl_val =
NULL;
183 char *old_te_val =
NULL;
186 int done = 0, replied = 0;
194 worker, conf,
uri,
url, server_portstr,
195 &old_cl_val, &old_te_val);
214 header_brigade, 1)) !=
OK)
223 "error apr_pollset_create()");
241 pollfd.desc.s = client_socket;
265 "woke from poll(), i=%d",
pollcnt);
274 "sock was readable");
286 "error on backconn");
292 "unknown event on backconn %d",
pollevent);
296 else if (
cur->desc.s == client_socket) {
300 "client was readable");
312 "error on client conn");
318 "unknown event on client conn %d",
pollevent);
324 "unknown socket in pollset");
332 "finished with poll() - cleaning up");
352 &proxy_wstunnel_module);
354 char server_portstr[32];
377 "declining URL %s",
url);
388 "require upgrade for URL %s "
389 "(Upgrade header is %s, expecting %s)",
412 sizeof(server_portstr));
420 "failed to make connection to backend: %s",
461 ? add->fallback_to_proxy_http
462 :
base->fallback_to_proxy_http;
463 new->fallback_to_proxy_http_set = (add->fallback_to_proxy_http_set
464 ||
base->fallback_to_proxy_http_set);
481 (ap_find_linked_module(
"mod_proxy_http.c") !=
NULL);
490 "whether to let mod_proxy_http handle the upgrade and tunneling, "
498 static const char *
const aszSucc[] = {
"mod_proxy_http.c",
NULL};
apr_size_t const unsigned char unsigned int unsigned int d
static apr_pool_t * pconf
#define ap_get_module_config(v, m)
void ap_hook_post_config(ap_HOOK_post_config_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
#define AP_DECLARE_MODULE(foo)
#define AP_INIT_FLAG(directive, func, mconfig, where, help)
request_rec int int apr_table_t const char * path
#define ap_xlate_proto_to_ascii(x, y)
apr_status_t ap_remove_input_filter_byhandle(ap_filter_t *next, const char *handle)
#define ap_get_core_module_config(v)
apr_socket_t * ap_get_conn_socket(conn_rec *c)
const unsigned char * buf
const char apr_port_t port
#define APR_STATUS_IS_EINTR(s)
#define APR_BRIGADE_INSERT_TAIL(b, e)
const char apr_ssize_t int flags
const char *const const char *const * aszSucc
#define HTTP_SERVICE_UNAVAILABLE
#define HTTP_UPGRADE_REQUIRED
#define HTTP_INTERNAL_SERVER_ERROR
int ap_proxy_connect_backend(const char *proxy_function, proxy_conn_rec *conn, proxy_worker *worker, server_rec *s)
apr_status_t ap_proxy_transfer_between_connections(request_rec *r, conn_rec *c_i, conn_rec *c_o, apr_bucket_brigade *bb_i, apr_bucket_brigade *bb_o, const char *name, int *sent, apr_off_t bsize, int flags)
char * ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp, char **passwordp, char **hostp, apr_port_t *port)
int ap_proxy_release_connection(const char *proxy_function, proxy_conn_rec *conn, server_rec *s)
int ap_proxy_acquire_connection(const char *proxy_function, proxy_conn_rec **conn, proxy_worker *worker, server_rec *s)
char * ap_proxy_canonenc_ex(apr_pool_t *p, const char *x, int len, enum enctype t, int flags, int proxyreq)
#define PROXY_CANONENC_NOENCODEDSLASHENCODING
int ap_proxy_worker_can_upgrade(apr_pool_t *p, const proxy_worker *worker, const char *upgrade, const char *dflt)
void proxy_hook_canon_handler(proxy_HOOK_canon_handler_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
int ap_proxy_connection_create_ex(const char *proxy_function, proxy_conn_rec *conn, request_rec *r)
int ap_proxy_create_hdrbrgd(apr_pool_t *p, apr_bucket_brigade *header_brigade, request_rec *r, proxy_conn_rec *p_conn, proxy_worker *worker, proxy_server_conf *conf, apr_uri_t *uri, char *url, char *server_portstr, char **old_cl_val, char **old_te_val)
int ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, proxy_server_conf *conf, proxy_worker *worker, proxy_conn_rec *conn, apr_uri_t *uri, char **url, const char *proxyname, apr_port_t proxyport, char *server_portstr, int server_portstr_size)
void proxy_hook_scheme_handler(proxy_HOOK_scheme_handler_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
void proxy_hook_check_trans(proxy_HOOK_check_trans_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
int ap_proxy_pass_brigade(apr_bucket_alloc_t *bucket_alloc, request_rec *r, proxy_conn_rec *p_conn, conn_rec *origin, apr_bucket_brigade *bb, int flush)
#define STANDARD20_MODULE_STUFF
int ap_cstr_casecmp(const char *s1, const char *s2)
#define ap_strchr_c(s, c)
const char * ap_scan_vchar_obstext(const char *ptr)
int ap_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n)
void const char apr_status_t(* cleanup)(void *))
apr_vformatter_buff_t * c
#define apr_pcalloc(p, size)
apr_int32_t apr_int32_t apr_int32_t err
Proxy Extension Module for Apache.
static void * create_proxyws_dir_config(apr_pool_t *p, char *dummy)
static int can_fallback_to_proxy_http
static int proxy_wstunnel_request(apr_pool_t *p, request_rec *r, proxy_conn_rec *conn, proxy_worker *worker, proxy_server_conf *conf, apr_uri_t *uri, char *url, char *server_portstr)
static int proxy_wstunnel_canon(request_rec *r, char *url)
static const char * proxyws_fallback_to_proxy_http(cmd_parms *cmd, void *conf, int arg)
static void ws_proxy_hooks(apr_pool_t *p)
static int proxy_wstunnel_handler(request_rec *r, proxy_worker *worker, proxy_server_conf *conf, char *url, const char *proxyname, apr_port_t proxyport)
static int proxy_wstunnel_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
static const command_rec ws_proxy_cmds[]
static int proxy_wstunnel_check_trans(request_rec *r, const char *url)
static void * merge_proxyws_dir_config(apr_pool_t *p, void *vbase, void *vadd)
static sed_label_t * search(sed_commands_t *commands)
Structure to store things which are per connection.
Per-directory configuration.
unsigned int fallback_to_proxy_http_set
unsigned int fallback_to_proxy_http
A structure that represents the current request.
struct ap_filter_t * output_filters
struct ap_filter_t * proto_input_filters
apr_table_t * err_headers_out
struct ap_filter_t * proto_output_filters
struct ap_filter_t * input_filters
struct ap_conf_vector_t * per_dir_config
A structure to store information for each virtual server.
static apr_pollset_t * pollset
apr_status_t apr_socket_opt_set(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)