forwarder.h
//
// Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// See accompanying file COPYING.TXT file for licensing details.
//
#ifndef CPPCMS_FORWARDER_H
#define CPPCMS_FORWARDER_H
#include <cppcms/defs.h>
#include <booster/hold_ptr.h>
#include <booster/shared_ptr.h>
#include <booster/noncopyable.h>
#include <booster/thread.h>
#include <string>
#include <map>
namespace cppcms {
class mount_point;
namespace http {
class context;
}
class CPPCMS_API forwarder {
public:
forwarder();
~forwarder();
typedef std::pair<std::string,int> address_type;
address_type check_forwading_rules(std::string const &h,std::string const &s,std::string const &p);
address_type check_forwading_rules(char const *h,char const *s,char const *p);
void add_forwarding_rule(booster::shared_ptr<mount_point> p,std::string const &ip,int port);
void remove_forwarding_rule(booster::shared_ptr<mount_point> p);
private:
typedef std::map<booster::shared_ptr<mount_point> ,address_type> rules_type;
rules_type rules_;
booster::shared_mutex mutex_;
struct _data;
booster::hold_ptr<_data> d;
};
void CPPCMS_API forward_connection(booster::shared_ptr<http::context> cont,std::string const &ip,int port);
}
#endif
booster::hold_ptr< _data >
booster::shared_mutex
Shared mutex or a.k.a. Read-Write Lock.
Definition: thread.h:166
booster::shared_ptr
Definition: log.h:25
cppcms::forward_connection
void CPPCMS_API forward_connection(booster::shared_ptr< http::context > cont, std::string const &ip, int port)
cppcms::forwarder
Class responsble for automaticall forwarding of HTTP/CGI requests to other hosts over SCGI...
Definition: forwarder.h:31