title: WSL2, Cannot reach localhost nodejs server on windows browser
body: <p>i have windows 10 wiht subsystem Linux (Ubuntu-20.04) and I am using WSL2. When I init frontend project (vue project) and I run <code>npm run serve</code> then everything works fine. The application ran on localhost:8080 as i expect. But when i created backend for this app (new project with nodejs, express) I started simple server and in terminal looks fine but when i wanted to go in browser to localhost:5000 to see basic Hello World, the page is loading for a while and then says the webpage localhost didnt send any data.</p>
  <p>Here is my app.ts</p>
  <pre><code>import express, { Application, Request, Response, NextFunction } from 'express'
  import bodyParser from 'body-parser'
  import cors from 'cors'
  import 'reflect-metadata'
  
  const app: Application = express()
  const port = 5000
  
  app.use(cors)
  app.use(bodyParser.json({ limit: '20480kb' }))
  
  app.get('/', (req, res) =&gt; {
      res.send('Hello!')
  })
  
  const server = app.listen(port, 'localhost', () =&gt; console.log(`The server is running on port ${port}.`))
  </code></pre>
  <p>Here is my package.json scripts (compile typescript to javascript works fine):</p>
  <pre><code>&quot;scripts&quot;: {
      &quot;start&quot;: &quot;nodemon dist/app.js&quot;,
      &quot;build&quot;: &quot;rm -rf dist/ &amp;&amp; tsc -w&quot;,
      &quot;commit&quot;: &quot;npx git-cz&quot;
    }
  </code></pre>
  <p>Here is my backend terminal, everything here works fine:</p>
  <p><a href="https://i.stack.imgur.com/pJIb9.png" rel="noreferrer">https://i.stack.imgur.com/pJIb9.png</a></p>
  <p>I tried to use netstat to see connection:</p>
  <p><a href="https://i.stack.imgur.com/n5naM.png" rel="noreferrer">https://i.stack.imgur.com/n5naM.png</a></p>
  <p>My problem is that i cant reach the server on web browser, please help.</p>