I am working on a mobile website and would like to test it using my iPhone browser. My Windows 7 machine and iPhone are on the same wireless network. How do I access localhost from the iPhone? Right now I get a 404 error.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
In my case first i connected my pc and mobile on the same network, you can ping your mobile from pc to test the connection.
I running my project with GGTS(Groovy/Grails Tool Suite) locally then accessing website from mobile using PC IP address and it's work very well.
PS. running from local it would give url like (http://localhost:8080/projectname) you should replace localhost with PC IP address if you are trying to access your local website from mobile
If you are using mac (OSX) :
On you mac:
If you are testing your website with the address : "localhost:8888/mywebsite" (it depends on your MAMP configurations)
On your phone :
Note : you have to be connected on the same network (wifi)
If you're using MAMP, key in your IP address (let's say 192.0.0.63) in your iPhone Safari browser, followed by the port number 8888 (e.g. 192.0.0.63:8888) and you will be able to see your local site in your iPhone.
And if you're using a WAMP server, again in your iPhone safari browser just key in the IP address (let's say 192.0.0.63) and that's it. But don't forget to remove the
deny from all
from the httpd.conf file for your WAMP server. If you look for the lineallow from 127.0.0.1
, above it or below of it you will seedeny from all
; just delete this line and restart your WAMP server and that should to the job.If you're using a Mac -
Connect your iPhone to your Mac via USB.
Go to Network Utility (cmd+space and type "network utility")
Go to the "Info" tab
Click on the drop down menu that says "Wi-Fi" and select "iPhone USB" as shown in the photo.
You'll find an IP address like "xxx.xxx.xx.xx" or similar. Open Safari browser on your iPhone and enter IP_address:port_number
Example: 169.254.72.86:3000
[NOTE: If the IP address field is blank, make sure your iPhone is connected via USB, quit Network Utility, open it again and check for the IP address.]
From my iphone I wanted to browse a website hosted on IIS server on my Windows 8 laptop. After some reading around, I opened Windows Firewall, selected "Allow an app or feature through Windows firewall". Then scrolled down and checked "World Wide Web Services (HTTP)" from the list. That's all, it worked. Hope it helps someone else too.
I wanted to accomplish the same thing as the original request, and looked for an answer here, and turned off every firewall and virusprotection to no avail.
Then, I found the following statment regarding IIS express in the microsoft documentation: "IIS express does not serve requests to a browser on another computer, making its approval easier in corporate environments".
Bottom line - you will have to install IIS (not the delivered IIS express) to get your project to be seen outside your computer.
Source: http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx
Hope this is helpfull to other people that are going nuts turning off every security feature on their computer.