3

Here is my concern :

On my pc running on Windows 64, I run a node server (via react) on an OpenSuse Leap 15.1 environment on WSL. React tells gives me the right url to connect on default port 3000, but the URL is not reachable on a browser, wether I try to access

http://jc:3000/
localhost:3000/

neither of the two works.

Compiled successfully!

You can now view learn-react in the browser.

  http://jc:3000/

Even if I change the port,it doesn't work either, any port do not work.

On the other hand, if I run an apache server on port 80, the localhost is reachable. Besides, any port with Apache works with localhost, but not with the hostname "jc".

What I tried :

I have tried to shutdown antivirus and firewall, it doesn't work either. I have set the OpenSuse to be run on WSL2.

My /etc/hosts file shows nothing particular I think :

# localhost name resolution is handled within DNS itself.
    127.0.0.1      localhost
#   ::1             localhost

The hostname of my Window pc is "jc" as you can see in the react display.

From this machine, from powerShell when I

ping jc, it's ok. When I telnet jc 3000, it's not ok.

Apache being run, telnet jc 80 => not ok

but telnet localhost 80 is ok !

I figure out that there is a problem with the hostname (it is resolved only with ping on the test I have made), but also with localhost when it's a node server. I don't know why...

EDIT : a simple nodejs server works too, like apache...So the trouble would come from React.

If anyone has an idea, thank you in advance.

jska13
  • 147
  • 3
  • 11
  • Can you share the output of `netstat -anot | findstr 3000` in Windows, output of `netstat -antp | grep 3000` in WSL and the output of `nslookup jc` in windows and WSL? – natenho Aug 02 '21 at 23:32

0 Answers0