Recently, I have been studying the development of mobile phone pages, but there has been no good way for mobile devices to directly access the service environment on their own computers.
With the help of several colleagues, I finally found a way to hide good things in private. I would like to share with you some help;
Premise: My computer is win7.
Step 1: Use your computer as a shared Wi-Fi hotspot
1. Run the following command as an administrator:
Netsh wlan set hostednetwork mode = allow ssid = mm key = 1234
The ssid is the wifi name, and the key is the password you need to connect to the wifi
2. Open Control Panel --- network and Internet --- network and sharing center --- change the adapter settings
You will see an additional Microsoft Virtual WiFi Miniport Adapter [wireless network connection 2]
Select your local connection and right-click the property --- share --- allow other users to connect to the computer through the Internet, and select [wireless network connection 2] That you just created]
3. Run netsh wlan start hostednetwork to enable the shared network
Use the android phone for verification after setting.
If there is no problem, you can save the following content as a file with the suffix bat to enable
Netsh wlan set hostednetwork mode = allow ssid = mm key = 1234
Netsh wlan start hostednetwork
Step 2: Set your host
Add a host rule as follows:
The ip address of your computer's local service domain;
Assume that the local ip address is 192.168.1.1, and the local service domain is www. tes. ocm, the host is:
192.168.1.1 www.test.com
Step 3: connect your phone to wifi
Pick up your phone, search for the created Wi-Fi name, and enter the corresponding password. You can access www.test.com in your browser.
At this point, you can modify it on your computer, instead of repeatedly uploading it to the server environment, and view the effect directly on your mobile phone.