How to enable a handheld device to access a computer's local server

Source: Internet
Author: User

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.

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.