0

I'm a cloud engineer and I've tried IP address hosting in angular project, but it is still wrong. Again I'm making the question clear, I need to access an application running in local of a system and it needs to be accessed from another system.

krishnaGR
  • 1
  • 1
  • Does this answer your question? [How do I use a mobile phone to open localhost:4200?](https://stackoverflow.com/questions/47493325/how-do-i-use-a-mobile-phone-to-open-localhost4200) – Mahdi Zarei Dec 16 '21 at 11:21
  • "hosting in angular project", so how did you do that? As a cloud engineer, I assume you have some basic networking knowledge to know if something only listens on localhost traffic then it won't be able to handle external traffic from outside. You need to configure it to listen on the right site binding or set up a reverse proxy. – Lex Li Dec 16 '21 at 16:39

3 Answers3

2
  1. Find you IPv4 address(Usually 192.168.x.x)
  2. ng serve --host 192.168.x.x
  3. Access from the same network using 192.168.x.x:4200
Dev Gourav
  • 136
  • 8
0

Follow these steps:

  1. Both systems need to be connected on the same network. (LAN or WiFi)

  2. Serve the app on one system.

  3. Go to the CMD and run ipconfig.

  4. Search for IPv4 Address in the result.

enter image description here

  1. On the second system, in browser open <ip-of-the-first-system>:<port>. (Example: 192.127.12.2:4200)
Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54
  • 1
    Thanks for your solution. but it is not working, it says the site cannot be reached. And both the devices are connected in the same wifi network and i've tried it in mobile and mac. – krishnaGR Dec 19 '21 at 13:23
0

I've used port forwarding. I ran an angular application in my local system and i exposed the port that the application is running. And i achieved this through ngrok. Its kind of unsecured but still for experimental purposes it worked fine.

krishnaGR
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 07 '22 at 08:37