SSL socket class, downloadertest application, HTTP::Downloader support for HTTPS connections, authentication, proxies and POST requests

# Conflicts:
#	CMakeLists.txt
This commit is contained in:
Thulinma 2017-11-01 19:34:53 +01:00
parent 17baf864d1
commit 09733c3976
2 changed files with 21 additions and 1 deletions

View file

@ -438,7 +438,6 @@ makeOutput(RTSP rtsp)#LTS
makeOutput(WAV wav)#LTS makeOutput(WAV wav)#LTS
if (NOT DEFINED NOSSL ) if (NOT DEFINED NOSSL )
makeOutput(HTTPS https)#LTS makeOutput(HTTPS https)#LTS
target_link_libraries(MistOutHTTPS mbedtls mbedcrypto mbedx509)
endif() endif()
makeOutput(DASH dash_mp4 http)#LTS makeOutput(DASH dash_mp4 http)#LTS
@ -683,4 +682,7 @@ add_test(AESTest COMMAND aes_ctr128)
add_executable(urltest test/url.cpp ${BINARY_DIR}/mist/.headers) add_executable(urltest test/url.cpp ${BINARY_DIR}/mist/.headers)
target_link_libraries(urltest mist) target_link_libraries(urltest mist)
add_test(URLTest COMMAND urltest) add_test(URLTest COMMAND urltest)
add_executable(downloadertest test/downloader.cpp ${BINARY_DIR}/mist/.headers)
target_link_libraries(downloadertest mist)
add_test(DownloaderTest COMMAND downloadertest)

18
test/downloader.cpp Normal file
View file

@ -0,0 +1,18 @@
#include "../lib/downloader.cpp"
#include <iostream>
int main(int argc, char ** argv){
if (argc < 2){
std::cout << "Usage: " << argv[0] << " URL" << std::endl;
return 1;
}
HTTP::Downloader d;
if (d.get(argv[1])){
std::cout << d.data() << std::endl;
std::cerr << "Download success!" << std::endl;
}else{
std::cerr << "Download fail!" << std::endl;
}
return 0;
}