0

I want to make a website and integrate RocketChat server in it. My application runs on localhost:2222 server (generated with the Laragon app) and my RocketChat server runs using Windows Subsystem for Linux on localhost:3000.

The problem is that when I try to send a request from my localhost:2222 to RocketChat's localhost:3000 I receive the error Idle timeout reached for "http://localhost:3000/api/v1/login". I worked for days at it, but I still don't know how to solve it :(

This is the request that I want to send, in the "/api/v1/user/login" route:

   class InboxController extends AbstractController
{
    const RocketChatServer = 'http://localhost:3000/api/v1';
    /**
     * @Route("/inbox", name="inbox")
     */
    public function index(): Response
    {
        return $this->render('inbox.html.twig', [
            'controller_name' => 'InboxController',
        ]);
    }

    /**
     * @Route ("/api/v1/user/login", name="rocket_login", methods={"POST"})
     */
    public function login(Request $request){
        $client =HttpClient::create();
        $loginRequest = $client->request('POST', self::RocketChatServer . "/login", [
            'json' => [
                'user' => 'username',
                'password' => 'password'
            ],
        ]);

        return new JsonResponse([
            'message' => 'User logged id'
        ]);
    }
}

Can you tell me why I receive this error and how could I solve it, please?

alinrj
  • 11
  • 2
  • 1
    You need to configure bridging/port forwarding between the 2 networks. They can't talk to each other by default. It will likely be easiest to run both services on the Linux side of things, or use Docker containers in Windows. – miken32 Jun 08 '21 at 23:41

0 Answers0