mod_proxy.h revision 63f0a4cce2c24181e97940eb9d61b75591ee6ed8
55cf6e01272ec475edea32aa9b7923de2d36cb42Christian Maeder/* Licensed to the Apache Software Foundation (ASF) under one or more
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * contributor license agreements. See the NOTICE file distributed with
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * this work for additional information regarding copyright ownership.
b43458b4d81f7451112cecbd757f3a05216e7088Kristina Sojakova * The ASF licenses this file to You under the Apache License, Version 2.0
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * (the "License"); you may not use this file except in compliance with
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * the License. You may obtain a copy of the License at
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * http://www.apache.org/licenses/LICENSE-2.0
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * Unless required by applicable law or agreed to in writing, software
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * distributed under the License is distributed on an "AS IS" BASIS,
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * See the License for the specific language governing permissions and
14650c9e129d8dc51ed55b2edc6ec27d9f0f6d00Kristina Sojakova * limitations under the License.
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova * @brief Proxy Extension Module for Apache
b2e01ef1b5d4c7a62260eb792291e8e1b10e545bIulia Ignatov * @defgroup MOD_PROXY mod_proxy
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova * @ingroup APACHE_MODS
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova/* for proxy_canonenc() */
ccaa75089b23c0f043cdbd4001cba4e076ca4fd3Kristina Sojakova enc_path, enc_search, enc_user, enc_fpath, enc_parm
80d2ec8f37d5ddec13c14b17b1bab01e9c94630aChristian Maeder#else /*APR_CHARSET_EBCDIC*/
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova#endif /*APR_CHARSET_EBCDIC*/
a669e4685b32ff5ca1bca785eacc5e30a545b010Christian Maeder/* default Max-Forwards header setting */
a669e4685b32ff5ca1bca785eacc5e30a545b010Christian Maeder/* Set this to -1, which complies with RFC2616 by not setting
d2786879b4733fd4886a5b654f7c6de1d234f638Kristina Sojakova * max-forwards if the client didn't send it to us.
b3bacd257ffcdd346b70ab690f03b28ad5f33fdcKristina Sojakovatypedef struct proxy_balancer proxy_balancer;
a669e4685b32ff5ca1bca785eacc5e30a545b010Christian Maedertypedef struct proxy_conn_pool proxy_conn_pool;
b3bacd257ffcdd346b70ab690f03b28ad5f33fdcKristina Sojakovatypedef struct proxy_balancer_method proxy_balancer_method;
a669e4685b32ff5ca1bca785eacc5e30a545b010Christian Maeder/* static information about a remote proxy */
d71bb9deea089887b4fd829c5b766e7e4de9f204Kristina Sojakova const char *scheme; /* the schemes handled by this proxy, or '*' */
abd5fc85dc7e19b1614890182436940e922963a4Kristina Sojakova const char *protocol; /* the scheme used to talk to this proxy */
168d206b4e5fd436c98239a1b6629c651f54c8eeKristina Sojakova const char *hostname; /* the hostname of this proxy */
80d2ec8f37d5ddec13c14b17b1bab01e9c94630aChristian Maeder ap_regex_t *regexp; /* compiled regex (if any) for the remote */
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova int use_regex; /* simple boolean. True if we have a regex pattern */
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova apr_port_t port; /* the port for this proxy */
e8dd447a2aa5fbac10668749dfe4142c05ec3d7dKristina Sojakova proxy_balancer *balancer; /* only valid for reverse-proxys */
b2e01ef1b5d4c7a62260eb792291e8e1b10e545bIulia Ignatov int (*matcher) (struct dirconn_entry * This, request_rec *r);
struct noproxy_entry {
const char *name;
const char *id;
long maxfwd;
signed char interpolate_env;
const char *hostname;
struct proxy_conn_pool {
/* Keep below in sync with proxy_util.c! */
#define PROXY_COPY_CONF_PARAMS(w, c) \
unsigned int def;
unsigned int fnv;
} proxy_hashes ;
apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */
struct proxy_worker {
struct proxy_balancer {
struct proxy_balancer_method {
request_rec *r);
#define PROXY_THREAD_LOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_lock((x)->tmutex) : APR_SUCCESS)
#define PROXY_THREAD_UNLOCK(x) ( (x) && (x)->tmutex ? apr_thread_mutex_unlock((x)->tmutex) : APR_SUCCESS)
#define PROXY_GLOBAL_LOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_lock((x)->gmutex) : APR_SUCCESS)
#define PROXY_GLOBAL_UNLOCK(x) ( (x) && (x)->gmutex ? apr_global_mutex_unlock((x)->gmutex) : APR_SUCCESS)
#if !defined(WIN32)
#define PROXY_DECLARE_DATA
#define PROXY_DECLARE_DATA
char *url))
request_rec *r,
/* proxy_util.c */
PROXY_DECLARE(int) ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr);
PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t *, const char *, proxy_server_conf *, request_rec *);
request_rec *r);
PROXY_DECLARE(const char *) ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var);
PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url);
PROXY_DECLARE(const char *) ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str);
#if !defined(WIN32)
proxy_dir_conf *, const char *);
proxy_dir_conf *, const char *);
proxy_dir_conf *, const char *);
proxy_dir_conf *, const char *);
const char *url);
const char *url,
int do_malloc);
server_rec *s,
apr_pool_t *p);
const char *url,
int careactive);
const char *url);
const char *url,
const char *alias,
int do_malloc);
server_rec *s,
apr_pool_t *p);
* The balancer then rewrites the url to particular worker, like http://host:port
request_rec *r,
char **url);
request_rec *r,
char **url,
const char *proxyname,
char *server_portstr,
int server_portstr_size);
server_rec *s);
server_rec *s);
server_rec *s);
server_rec *s,
int ap_proxy_lb_workers(void);