I’m trying to create an HTTP Rest server on Unreal engine with HTTPServer module.
When I call the endpoint with localhost or 127.0.0.1 works fine, but when I use the machine IP i have an HTTP Error (Request timeout or Connection Refused).
What could be the problem?
Thanks
void AServerGameMode::StartPlay()
{
Super::StartPlay();
auto HttpServerModule = &FHttpServerModule::Get();
//UE_LOG(LogTemp, Log, TEXT("Starting UnrealHttpServer Server..."));
TSharedPtr<IHttpRouter> HttpRouter = HttpServerModule->GetHttpRouter(Port);
FHttpPath CommandPath(FEndpoint::SendCommand);
FHttpRouteHandle HttpRouteHandle = HttpRouter->BindRoute(CommandPath, EHttpServerRequestVerbs::VERB_PUT,
[this](const FHttpServerRequest& Request, const FHttpResultCallback& OnComplete)
{
return RequestMessageHandler(Request, OnComplete);
}
);
// Start Listeners
HttpServerModule->StartAllListeners();
}