I am using Genymotion to test an app. The app is basically a browser that connects to my website. I do not have the app’s source.
I do the development and testing of the website in a domain like this: dev.mywebsite.com
The app connects to mywebsite.com. Genymotion allows me to use an HTTP proxy. My question is, is there any software for windows or linux that would work as a proxy and redirect all requests to mywebsite.com to dev.mywebsite.com ?
1
This is the classic purpose of using a hosts file. It’s a very simple to edit file wherein you can put manual overrides for domain names to force them to resolve to some given IP.
Windows
Here’s a simple tutorial on how to edit your windows hosts file: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/
Example of windows hosts file (C:windowssystem32driversetchosts):
102.54.94.97 rhino.acme.com # source server
38.25.63.10 x.acme.com # x client host
In the windows host file you can see the #
mark identifying the start of a comment which is ignored by the OS.
Linux
Here’s the linux man page for the linux /etc/hosts file which is nigh identical to the windows hosts file, examples at the bottom of the man page make fairly clear how it works: http://man7.org/linux/man-pages/man5/hosts.5.html
Example of linux /etc/hosts file:
127.0.0.1 localhost
192.168.1.10 foo.mydomain.org foo
192.168.1.13 bar.mydomain.org bar
146.82.138.7 master.debian.org master
209.237.226.90 www.opensource.org
The linux host file also recognizes the #
as beginning of comments just the same as the windows file.
2