Made protocol() const, added default proxy ports, and added handshake on https proxy (based on #83)
This commit is contained in:
parent
4141b76574
commit
599775c83f
3 changed files with 47 additions and 18 deletions
|
|
@ -199,7 +199,7 @@ namespace SimpleWeb {
|
|||
return parsed_host_port;
|
||||
}
|
||||
|
||||
virtual std::string protocol()=0;
|
||||
virtual std::string protocol() const =0;
|
||||
virtual void connect()=0;
|
||||
|
||||
std::shared_ptr<boost::asio::deadline_timer> get_timeout_timer() {
|
||||
|
|
@ -366,7 +366,7 @@ namespace SimpleWeb {
|
|||
Client(const std::string& server_port_path) : ClientBase<HTTP>::ClientBase(server_port_path, 80) {}
|
||||
|
||||
protected:
|
||||
std::string protocol() {
|
||||
std::string protocol() const {
|
||||
return "http";
|
||||
}
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ namespace SimpleWeb {
|
|||
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)));
|
||||
else {
|
||||
auto proxy_host_port=parse_host_port(config.proxy_server, 0);
|
||||
auto proxy_host_port=parse_host_port(config.proxy_server, 8080);
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue