if you are on windows, edit the \windows\system32\drivers\etc\hosts file and add a line like this:
127.0.0.1 username.mysite.com
then when the server is running, you could open the browser and type:
http://username.mysite.com
http://username.mysite.com:8080
or whatever and see the website.
you will need admistrator privileges for this.
if you are on linux, you will need to edit /etc/hosts, and do the same thing.
however, when you are deploying, it is more about configuring the webserver and the dns server. so if you want to get the full experience, you should install a dns server locally and use that as your networks nameserver. this is a more complicated task, and the instructions depend on whether you are on linux or windows, and which webserver you are using.
then you have to write a bit of code in your application to check the server variables to find out which subdomain was used and do the processing based on that.