IXWebSocket/examples/http_client/http_client.cpp
Benjamin Sergeant 2a17cad1bf add skeleton and broken http client code.
GET returns "Resource temporarily unavailable" errors...
2019-02-14 10:14:57 -08:00

33 lines
537 B
C++

/*
* http_client.cpp
* Author: Benjamin Sergeant
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
*/
#include <iostream>
#include <sstream>
#include <ixwebsocket/IXHttpClient.h>
using namespace ix;
void run(const std::string& url)
{
HttpClient httpClient;
httpClient.get(url);
}
int main(int argc, char** argv)
{
if (argc != 2)
{
std::cerr << "Usage: ws_connect <url>" << std::endl;
return 1;
}
std::string url = argv[1];
Socket::init();
run(url);
return 0;
}