Reputation: 17094
I am running IIS express through visual studio 2015. It launches http://localhost:60355/
I setup a proxy through the node module IISexpress-proxy to forward port 8000 to 60355
Now I can access my web app remotely by typing my IP:port (192.xxx.xxx.x:8000)
I would like to know how I can map a hostname to my ip so I can type:
and it loads up the site I'm serving through visual studio. Thanks!
Upvotes: 1
Views: 4862
Reputation: 2534
On the remote computer, you can update your HOSTS file (located in %systemroot%\system32\drivers\etc\hosts
for Windows, and /etc/hosts
for OS X) and add an entry similar to the one below:
192.xxx.xxx.xxx mydev # Use actual IP of the dev box
You will need admin (or su) privileges to make this change. After updating the hosts file, if you have difficulty getting it to work, flush your DNS cache as so:
For Windows (from a command prompt):
> ipconfig /flushdns
For OS X (from the Terminal window):
$ sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;
and try again.
(Updating with info for Android)
I don't have any experience editing system files in Android, but search results suggests that it's possible, if you've rooted your device, or if you're using Android Debug Bridge (ADB).
If you're dealing with multiple devices and don't want to deal with the headache of managing hosts file changes for every device, you can also look into using a free dynamic DNS service provider, such as noip.com or changeip.com. However, these will require you to run a client on your web server and you'll also need to access your server from an internet IP, which means editing your router settings to map the port on the router to the port on the local machine. If you plan to go this route, first see if your router already supports some sort of built-in dynamic DNS setup (e.g. my Motorola Cable Modem & Router offers this). If you're comfortable with the idea of replacing your router's firmware with something like DD-WRT, the custom O/S of DD-WRT also supports an internal DNS setup where it can resolve internal IP addresses to local machine names.
Upvotes: 3