fix: client and server

This commit is contained in:
bookug 2017-06-22 12:55:10 +08:00
parent a1ed886364
commit b6296edb9c
3 changed files with 3 additions and 2 deletions

View File

@ -388,7 +388,7 @@ namespace SimpleWeb {
if(config.proxy_server.empty()) if(config.proxy_server.empty())
query=std::unique_ptr<boost::asio::ip::tcp::resolver::query>(new boost::asio::ip::tcp::resolver::query(host, std::to_string(port))); query=std::unique_ptr<boost::asio::ip::tcp::resolver::query>(new boost::asio::ip::tcp::resolver::query(host, std::to_string(port)));
else { else {
auto proxy_host_port=parse_host_port(config.proxy_server, 9000); auto proxy_host_port=parse_host_port(config.proxy_server, 80);
query=std::unique_ptr<boost::asio::ip::tcp::resolver::query>(new boost::asio::ip::tcp::resolver::query(proxy_host_port.first, std::to_string(proxy_host_port.second))); query=std::unique_ptr<boost::asio::ip::tcp::resolver::query>(new boost::asio::ip::tcp::resolver::query(proxy_host_port.first, std::to_string(proxy_host_port.second)));
} }
resolver.async_resolve(*query, [this](const boost::system::error_code &ec, resolver.async_resolve(*query, [this](const boost::system::error_code &ec,

View File

@ -424,7 +424,7 @@ namespace SimpleWeb {
config.timeout_content=timeout_content; config.timeout_content=timeout_content;
} }
Server() : ServerBase<HTTP>::ServerBase(80) {} Server() : ServerBase<HTTP>::ServerBase(9000) {}
protected: protected:
void accept() { void accept() {

View File

@ -2,6 +2,7 @@
#define __HTTP_CURL_H__ #define __HTTP_CURL_H__
//REFERENCE: https://curl.haxx.se/ //REFERENCE: https://curl.haxx.se/
//libcurl is useful for developing http client, but not for server
// //
//TODO: deal with cookie //TODO: deal with cookie
//URL encode: http://www.ruanyifeng.com/blog/2010/02/url_encoding.html //URL encode: http://www.ruanyifeng.com/blog/2010/02/url_encoding.html