mod_proxy.h revision 6428447d92427373f04e2285573fcb8c3a6c5c1f
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder/* Licensed to the Apache Software Foundation (ASF) under one or more
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * contributor license agreements. See the NOTICE file distributed with
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * this work for additional information regarding copyright ownership.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * The ASF licenses this file to You under the Apache License, Version 2.0
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * (the "License"); you may not use this file except in compliance with
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * the License. You may obtain a copy of the License at
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * http://www.apache.org/licenses/LICENSE-2.0
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * Unless required by applicable law or agreed to in writing, software
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * distributed under the License is distributed on an "AS IS" BASIS,
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
421def3c7b0b9ca7762f809a2c57c6ee74495ffaJonathan von Schroeder * See the License for the specific language governing permissions and
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * limitations under the License.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * @brief Proxy Extension Module for Apache
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * @defgroup MOD_PROXY mod_proxy
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder * @ingroup APACHE_MODS
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder Also note numerous FIXMEs and CHECKMEs which should be eliminated.
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder This code is once again experimental!
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder 1. Make it completely work (for FTP too)
f9096659967df62573bb5a5fd069c41bf5a0eca1Jonathan von Schroeder Chuck Murcko <chuck@topsail.org> 02-06-01
#include "apr_reslist.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#include "httpd.h"
#include "http_config.h"
#include "ap_config.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_vhost.h"
#include "http_main.h"
#include "http_log.h"
#include "http_connection.h"
#include "util_filter.h"
#include "util_ebcdic.h"
#include "ap_provider.h"
enum enctype {
struct proxy_remote {
struct proxy_alias {
const char *real;
const char *fake;
unsigned int flags;
struct dirconn_entry {
char *name;
struct noproxy_entry {
const char *name;
char req_set;
char viaopt_set;
char recv_buffer_size_set;
char io_buffer_size_set;
long maxfwd;
char maxfwd_set;
int error_override;
int error_override_set;
int preserve_host;
int preserve_host_set;
char timeout_set;
char badopt_set;
char proxy_status_set;
const char *ftp_directory_charset;
int interpolate_env;
const char *hostname;
int is_ssl;
#if APR_HAS_THREADS
struct proxy_conn_pool {
#if APR_HAS_THREADS
#define PROXY_WORKER_IS_INITIALIZED(f) ( (f)->s && \
#define PROXY_WORKER_IS_STANDBY(f) ( (f)->s && \
#define PROXY_WORKER_IS_USABLE(f) ( (f)->s && \
int status;
struct proxy_worker {
const char *name;
char timeout_set;
apr_interval_time_t acquire; /* acquire timeout when the maximum number of connections is exceeded */
char acquire_set;
char recv_buffer_size_set;
char io_buffer_size_set;
char keepalive;
char keepalive_set;
int is_address_reusable;
#if APR_HAS_THREADS
char ping_timeout_set;
char retry_set;
char disablereuse;
char disablereuse_set;
struct proxy_balancer {
char max_attempts_set;
#if APR_HAS_THREADS
struct proxy_balancer_method {
request_rec *r);
#if APR_HAS_THREADS
#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(apr_status_t) ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *bb, char *buff, size_t bufflen, int *eos);
PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **, const char *, apr_sockaddr_t *, const char *, proxy_server_conf *, server_rec *, apr_pool_t *);
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);
apr_pool_t *p,
const char *url);
server_rec *s);
server_rec *s);
const char *url);
apr_pool_t *p,
const char *url);
* 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);