C ++ RSDK卡萨布兰卡听众与外部uri [英] C++ RSDK Casablanca listener with extern uri

查看:91
本文介绍了C ++ RSDK卡萨布兰卡听众与外部uri的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现这个等待端口和发送请求的有用代码,但问题是因为它想要为外部地址(如www.google.com)工作,现在我的问题是如何让监听器监听外部地址卡萨布兰卡?



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?

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();

推荐答案

尝试询问https://casablanca.codeplex.com/wikipage?title=HTTP%20Listener [ ^ ]。


这篇关于C ++ RSDK卡萨布兰卡听众与外部uri的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆