One of the more frustrating aspects of the ASP.NET development server is the impossibility of debugging on it from a remote location.  There are myriad use cases for this, such as doing browser dependent testing (IE6m for instance), debugging from mobile devices, etc. Being able to receive external traffic while debug locally is such a routine exercise (while doing Java professional work, for instance), that it befuddles the mind to think why Microsoft intentionally prevents developers from doing this.

One way around this silliness is by doing a port forward.  I downloaded a free command line utility called rinetd. All you have to do is tell it an open port to listen on and the port it should forward to. Then, you can point a virtual machine, mobile device, etc. to the specified port on your local machine and interact with it without any problems.

Here's an example config file for it:

0.0.0.0 8080 127.0.0.1 1395
0.0.0.0 9080 127.0.0.1 1395

This instructs the utility to listen on all interfaces (0.0.0.0) on port 8080 and forward it to address 127.0.0.1 on port 1395.  Below are the contents of a batch file I created to simplify running it from the command line:

@echo off
echo ================================================
echo Running rinetd with the following configuration:
echo ================================================
type rinetd.conf
rinetd.exe -c rinetd.conf

Happy debugging!
posted on Sunday, May 30, 2010 10:14 PM |

Comments

Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by Chris Danielson
on 6/23/2010 10:24 AM
Thank you for sharing this. It's a real life saver especially when debugging and developing complex systems. I'm working on the following techniques for debugging and it helped immensely.

iPhone -> App Dev Server -> Sql Server
Android -> App Dev Server -> ...

And it's all running on a Mac with Parallels. rinetd works well. You rock!
Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by Don Dimon
on 7/27/2010 2:11 PM
Awesome thank you! - works like a pro - can now demo my pages on my iPad, phone, etc.
Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by Zakhar
on 8/2/2010 10:29 AM
I'm getting
rinetd: couldn't bind to address 0.0.0.0 port 8080
Am I doing something wrong?
Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by Fabrizio
on 2/10/2011 8:23 AM
Than you very much. Very useful :)
Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by jim
on 3/23/2011 11:13 AM
u r a life saver. Many Thanks!
Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by Alex
on 7/11/2011 6:02 PM
could you please describe the step by step process of accomplishing this? I have a web app that runs on local host and I want to be able to access it from other computers on the network
Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by Lab
on 1/27/2012 3:33 AM
If you are having problems with rinetd then there is a guide for doing the same thing but with Nginx: www.flyingtophat.co.uk/...
Gravatar
# re: Remote Access To ASP.NET Development Server
Posted by Nicke
on 1/29/2012 4:34 AM
Works just fine, thanks!
Post Comment
Title *
Name *
Email
Url
Comment *  
Please add 2 and 3 and type the answer here: