TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to test a localhost (desktop) from mobile?

3 点作者 bazookaBen超过 12 年前
Any easy way to do this? I don't want to mess with router port forwarding

5 条评论

MattBearman超过 12 年前
If you're on the same lan it's as simple as going to the IP address of the local server on your phone.<p>I recently tried exactly this. Running MAMP on my MacBook pro, went to 192.168.0.5 (my MacBook's IP address) on my iPhone while connected to the same wifi as the MacBook and there was the MAMP localhost page.<p>The only problem is (as far as I know) there's no way to edit /etc/hosts on an iPhone (although I imagine you can do it on Android), so it has to be IP based.
评论 #4401728 未加载
pixelcort超过 12 年前
If you are using an iOS device and your server is on the same network, you can use Bonjour/ZeroConf to quickly access it. For OS X, you can set the hostname in System Preferences &#62; Sharing. Then just access hostname.local from the iOS device.
bazookaBen超过 12 年前
SHIM looks pretty promising, and runs on nodeJS <a href="https://github.com/marstall/shim" rel="nofollow">https://github.com/marstall/shim</a><p>Any non-nodeJS alternatives?
jongold超过 12 年前
On the same network? Assuming you're running a server can't you just got to your local IP:port? (or bazookaBen.local:port on a Mac)
bazookaBen超过 12 年前
also found Drive-In, which runs on Apache+PHP <a href="https://github.com/scottjehl/Drive-In" rel="nofollow">https://github.com/scottjehl/Drive-In</a>