## Class server

zeep::http::server

## Synopsis

    // In header: </home/maarten/projects/libzeep/zeep/http/server.hpp>

    class server : public zeep::http::request_handler {
    public:
      // construct/copy/destruct
      server();
      server(const server &);
      server& operator=(const server &);
      ~server();

      // public member functions
      void bind(const std::string &, unsigned short);
      void run(int);
      void stop();
      void log_forwarded(bool);
      std::string address() const;
      unsigned short port() const;
      boost::asio::io_service & get_io_service();

      // public static functions
      static std::ostream & log();

      // protected member functions
      void handle_request(const request &, reply &);
      void log_request(const std::string &, const request &, const reply &,
                       const boost::posix_time::ptime &, const std::string &,
                       const std::string &, const std::string &);

      // private member functions
      void handle_request(boost::asio::ip::tcp::socket &, const request &,
                          reply &);
      void handle_accept(const boost::system::error_code &);
    };

## Description

### `server` public construct/copy/destruct

1.     server();

2.     server(const server &);

3.     server& operator=(const server &);

4.     ~server();

### `server` public member functions

1.     void bind(const std::string & address, unsigned short port);

   Bind the server to address and port.

2.     void run(int nr_of_threads);

3.     void stop();

4.     void log_forwarded(bool v);

   log_forwarded tells the HTTP server to use the last entry in X-Forwarded-For as client log entry

5.     std::string address() const;

6.     unsigned short port() const;

7.     boost::asio::io_service & get_io_service();

   get_io_service has to be public since we need it to call notify_fork from child code

### `server` public static functions

1.     static std::ostream & log();

   to extend the log entry for a current request, use this ostream:

### `server` protected member functions

1.     void handle_request(const request & req, reply & rep);

2.     void log_request(const std::string & client, const request & req,
                        const reply & rep, const boost::posix_time::ptime & start,
                        const std::string & referer, const std::string & userAgent,
                        const std::string & entry);

   the default entry logger

### `server` private member functions

1.     void handle_request(boost::asio::ip::tcp::socket & socket,
                           const request & req, reply & rep);

2.     void handle_accept(const boost::system::error_code & ec);