Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
153 views
in Technique[技术] by (71.8m points)

android - my ip looks different in visual studio code when I change places

I don't understand why my ip looks different when I change places. When I'm in working place, the ip looks like a public ip like this58.122.101.xxx. But when I'm in my home, the ip looks like a private ip like this 192.168.0.6 in visual studio code. I don't understand this and the big problem is that I can't open the private site in my android webview. When I run my website in working plcae, the webview show this well. But when I run my website in my home, changing the public ip to private ip, I can't see the website. Even though I set the package.json setting, it's not working.

  "private": false

how to understand this weird happening?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

yarn dev --hostname 0.0.0.0 should do it.
More details here

Then, you can access it w/ something like 192.168.0.6:3000.

If you want to expose it publicly wo/ too much struggle, you could use one of those 2 modules too: https://modules.nuxtjs.org/?q=expose&orderBy=desc


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...