This commit is contained in:
DDVTech 2021-09-10 23:44:31 +02:00 committed by Thulinma
parent 5b79f296d6
commit fccf66fba2
280 changed files with 56975 additions and 71885 deletions

View file

@ -1,19 +1,18 @@
#include "../lib/http_parser.cpp"
#include <iostream>
int main(int argc, char ** argv){
int main(int argc, char **argv){
if (argc < 2){
std::cout << "Usage: " << argv[0] << " URL" << std::endl;
return 1;
}
HTTP::URL u(argv[1]);
for (int i = 1; i < argc; ++i){
if (i > 1){
u = u.link(argv[i]);
}
if (i > 1){u = u.link(argv[i]);}
std::cout << argv[i] << " -> " << u.getUrl() << std::endl;
std::cout << "Protocol: " << u.protocol << std::endl;
std::cout << "Host: " << u.host << " (Local: " << (Socket::isLocalhost(u.host)?"Yes":"No") << ")" << std::endl;
std::cout << "Host: " << u.host << " (Local: " << (Socket::isLocalhost(u.host) ? "Yes" : "No")
<< ")" << std::endl;
std::cout << "Port: " << u.getPort() << std::endl;
std::cout << "Path: " << u.path << std::endl;
std::cout << "Query: " << u.args << std::endl;
@ -24,4 +23,3 @@ int main(int argc, char ** argv){
}
return 0;
}