Search code examples
node.jsvue.jsvue-cli

Why can't I access my own Vue Webpack server via LAN from another device?


I'm a bit new on this ground, and this is my first question. I'm asking you, because I couldn't solve this problem for 2-3 days, not even after reading a lot of material around this problem. What I found:

I initialize my vue webpack project like this with using npmas vue init webpack

After it finishes, I change host: 'localhost' to host: '0.0.0.0', and also add disableHostCheck: true.

In config/index.js dev scope, and I start my server with -> npm run dev

Output:

Compiled successfully in 3070ms                   
Your application is running here: http://0.0.0.0:8080

If I type in my Ipv4 address to the browser with :8080, like xxx.xxx.xxx.xxx:8080 my projects is there. It's fine, but I can't see my project from another device, like laptop or mobile phone.

I don't really understand this, because I read that if we type in '0.0.0.0' to the host, it means everyone can get access to the project on LAN.

Could somebody tell me please why is this happening?


Solution

  • Okay guys, i solved this. I will write down the solution, because its so funny and so annoying at the same time when you cant solve something, because of one little thing you dont even think of.

    The solution: just enable your ports in the damn windows firewall :D

    Now i can host everything, in lan, and public too.