Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I find this useful code that wait on port and send request, but the problem is cause it want work for external addresses (like www.google.com), now my question is how to make listener to listen for external addresses in casablanca?

C++
http_listener listenerVoices(L"http://localhost:8080/hello");
// http_listener listenerVoices(L"https://www.google.com/"); this don't work
listenerVoices.open().wait();

listenerVoices.support(web::http::methods::GET, [](web::http::http_request request)
{
    request.reply(web::http::status_codes::OK, L"Hello world");
}
);

std::string line;
std::cout << "Press enter to exit" << std::endl;
std::getline(std::cin, line);

listenerVoices.close().wait();
Posted

1 solution

 
Share this answer
 
Comments
novadivlja 11-Sep-14 10:19am    
thnx i try butt still no one didn't post some comment

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900