Connect to Live HTML Preview from another device on same network - visual-studio-code

I have downloaded and installed an extension to preview a webpage I'm working on inside the editor. It works fine, but I would like to also test the same HTML code on my mobile device as well. I have a normal home WiFi network. I was wondering if it is possible to somehow hook into the preview from another device besides the host computer. Is there a way to view the website from my phone on the same WiFi network, and access all of the website's served files, like index.html, /styles/.css, /scripts/.js, /images/*.jpg, etc?
Thank You!

very simple solution
turn on the live server on your pc
check the port where it's running
will look like 4400
check your LAN IP address will look like 192.172.123
Enter the address with the port number in this form (192.172.123:4400) on another device connected to the same router or device
Boom you can view changes as same you are using the same device

Sorry, I didn't realize that this functionality is already included in the wonderful extension that I originally downloaded - it's called Live Server by Ritwick Dey. On his GitHub repo, he outlines steps to remotely connect to the served website via another device on the same network (your phone for example). Tried it and it worked the first time!
https://github.com/ritwickdey/vscode-live-server/blob/master/docs/faqs.md

Related

LAN web server for testing my websites on my phone?

I am a front end web developer.
I would like a web server on my local wifi network for testing my websites on my phone. I am aware that there are several options out there but witch one would be best for quick testing of multiple websites (also a GUI would be preferable)
Thanks
What you want to do is pretty complex. You have to create and configure a DNS server then you have to configure your phone to get this DNS, etc.
If your phone is an android the best solution is to use your USB Cable and put your phone in dev mode, then you can debug your site with chrome directly on your phone.
how to: https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
For iPhone i don't know if is possible. But the common solution is to use the simulator.

hood.ie setting a fixed URL instead of network address

I've made a hood.ie app, where I will be using 2 devices (a laptop from where i do hoodie start) and an iPad.
At the moment, on the iPad i need to get the network address from the laptop from where the app actually sits to enter it in Safari on the iPad (this can also change depending on whats connected to the wifi network).
Is there a more convenient way to do this as the app has be started and logged into daily?
Thanks.
I'm afraid not, it's also not really part of Hoodie's scope. If you want to expose your local sever with less hassle, you could:
Give it a fixed IP address and just bookmark that on the ipad
Use a service like https://ngrok.com/ or http://localtunnel.me/ (especially the former) to have nicer or even fixed urls that tunnel through to your local server
Hope that helps!

Any way to browse wifi Harddisk through iPhone

I am having a wifi Harddisk , just want to connect and access the folders and document of wifi Harddisk from my iPhone through wifi and without using internet connectivity.
I want to create similar application mentioned below url:-
http://itunes.apple.com/us/app/goflex-media-seagate-technology/id431912202?mt=8 ?
As per GoFlex Satelliteā„¢ User Guide you can browse the HD contents with a web browser.
You (or your user) will have to manually connect to GoFlex Satellite WiFi network - it looks like this device starts it's own AdHoc network. Sorry to say it's not possible to automate this process from code - at least not without using private API's.
You can test if this works like this:
- connect to GoFlex Satelliti WiFi network with your iPhone
- open www.goflexsatellite.com in Safari
You can do this also from code using UIWebView.
A nice tutorial on using UIWebView can be found here - just remember to use www.goflexsatellite.com as a target URL.

How to connect iPhone Safari to Windows HTTP server?

I'm completely new to the iPhone, so this is a newbie question.
The web development environment I use at work is set up on Windows 7, running Tomcat as a web server. Web Apps are tested by pointing a browser to "localhost".
I've been asked to port a web front end to the iPhone. Since I need to use this same development environment I need to connect the iPhone to the PC via USB or Ethernet.
There is this answer:
"http://stackoverflow.com/questions/3132105/how-do-you-access-a-website-running-on-localhost-from-iphone-browser"
but I was hoping to do it without wireless.
Other questions I've researched are about iPhone development, the SDK, etc. I'm not developing iPhone code, only trying to get the iPhone Safari browser to access the IP address of the local PC, 192.168.xx.xx or whatever.
Seems like it should be simple, a matter of cabling?
it would be an issue of cabling... if the iPhone had an eternet jack :)
But the wifi connection is the only "network jack" the phone has that you can connect to your own network directly with, the 3G or CDMA port gets routed via your mobile phone company, nothing you can do about that. Hence the need for WiFi to access non-routable addresses, like ...
Another option would be to make your server internet-routable, like middapark said. Then you can access it via your mobile phone provider's network and the public internet and can do away with the need to use Wifi.
A third option is to create a VPN tunnel from your iPhone to your local network, again via your mobile phone provider's network and the public internet. But I have no expereince with doing that, so I can not give further advice there.
The problem is most likely because you're trying to get your iPhone to view an internal (i.e.: not internet viewable) network. (Address such as 192.168.0.0, 172.16.0.0 and 10.0.0.0 and are non-routable as far as the internet as a whole is concerned.)
As such, unless you can access your internal network via wifi (or you're prepared to expose the machine in question to the internet, in which case you'll need to use a different IP address) this isn't possible.

iPhone - see app documents folder using wifi?

The iPhone settings have an IP address for the device when it is connected to a wifi network. Is it possible to get this IP address and establish a connection between a desktop computer (on the same network) and the iPhone?
I want to be able to transfer files between the iPhone and the desktop computer. Some apps like the "Files" and "FourTrack" apps do this.
Can someone please guide me to where I can start?
Thanks a lot for any headsup
Google for SIOCGIFCONF and you'll find a bunch of example code in C for getting all your IP addresses. Once you've enumerated your devices, on iPhone they are always in the following order: Loopback, WiFi, WAN.
Once you have that, you can implement a web server with CocoaHttpServer pretty easily. You'll have to hack it to add directory listings and the like, but it's not too hard. It's not trivial, but it's not too bad.
I think you already answered your question... you have to download an app to do this. I use "Air Sharing" and it works fine.