I found a quick solution to this problem. Try this link. It should help you fix the problem.
I only changed one thing, where the tutorial states you change '127.0.0.1' to 'All', change it to the IP address your server is running on instead.
After that, you should be able to connect to your localhost.
Below is a (proofread) copy of the information from the linked page:
Step 1
Install the Wamp server (or any other you prefer).
This is one of the best servers I know to set up a local server. If you have installed Apache or any other server, ignore this step.
Download and install Wamp Server from here.
Step 2
Add a new rule for port 80 in Windows Firewall.
Open the Control Panel and select Windows Firewall.
Select Advanced settings from the left panel of the Windows Firewall setting page.
Select Inbound Rules from the left panel, then select New Rule.
Select Port and click Next.
Select the “Specific local ports” radio button and enter 80 as the port value.
Keep Allow the connection unchanged and move to the next step.
Keep Profile options unchanged and click Next.
Give some nice name to your new rule and click Finish.
This will enable port 80 access on local network IP.
Step 3
Edit the httpd.conf file of the Wamp server to fix the 403 error.
We need to edit this file. Otherwise, we will get the 403 forbidden error when we access the localhost through a local network IP.
Click on the Wamp server tray icon.
Open Apache server sub menu.
Select httpd.conf.
Find this section of configuration in the httpd.conf file:
Directory “c:/wamp/www/”
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag – don’t remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Find and replace ‘127.0.0.1’ with ‘All’, save the file, and restart your Wamp server.
Step 4
Find your local network IP.
Open the command prompt.
Type and enter the ipconfig
command.
In my case, my local area network address is 10.0.0.2.
This is the IP which you need to access your localhost on your Android phone over wifi. To test if it is working, type this IP address in your desktop browser where your localhost server is installed. The browser should display your localhost page successfully. This will assure that this local network IP is now successfully accessible on your Android phone.
I hope this tutorial will help you to access your localhost over wifi.