Adding support for IPv6.

This commit is contained in:
stephb9959
2021-12-08 16:53:06 -08:00
parent d1abb897af
commit 6f4ef3ca03
2 changed files with 8 additions and 3 deletions

View File

@@ -21,7 +21,9 @@ namespace OpenWifi {
Poco::URI DestinationURI(Svc.PrivateEndPoint);
DestinationURI.setPath(PathRewrite);
DestinationURI.setQuery(SourceURI.getQuery());
std::cout << Request->getMethod() << " " << DestinationURI.getHost() << ":" << DestinationURI.getPort() << DestinationURI.getPathAndQuery() << std::endl;
std::cout << " Source: " << SourceURI.toString() << std::endl;
std::cout << "Destination: " << DestinationURI.toString() << std::endl;
Poco::Net::HTTPSClientSession Session(DestinationURI.getHost(), DestinationURI.getPort());
Session.setKeepAlive(true);
@@ -50,8 +52,10 @@ namespace OpenWifi {
auto Body = P.parse(Request->stream()).extract<Poco::JSON::Object::Ptr>();
Poco::JSON::Stringifier::condense(Body,SS);
SS << "\r\n\r\n";
} catch(...) {
} catch(const Poco::Exception &E) {
std::cout << "E: " << E.name() << std::endl;
std::cout << "E: " << E.message() << std::endl;
std::cout << "E: " << E.what() << std::endl;
}
std::cout << ">>>" << SS.str() << std::endl;

View File

@@ -90,6 +90,7 @@ logout() {
startmfa() {
payload="{ \"type\" : \"sms\" , \"sms\" : \"$1\" }"
echo ${payload}
curl ${FLAGS} -X PUT "https://${target_service_endpoint}/api/v1/submfa?startValidation=true" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${token}" \