本地主机在 chrome 和 firefox 中不起作用 [英] Localhost not working in chrome and firefox

查看:42
本文介绍了本地主机在 chrome 和 firefox 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 2010(MVC3 Razor)和 Windows 7 做一个网络项目.

I am doing a web project using visual studio 2010(MVC3 Razor) and Windows 7.

我的默认浏览器是 IE.当我运行该项目时,该网站与 url 完美配合

My default browser is IE. When I run the project, the website working is perfectly with the url

http://localhost:49824/

当我复制相同的 url 并尝试在 Chrome 或 Firefox 中运行该网站时,它会显示以下错误.

When I copy the same url and try to run the website in Chrome or Firefox it shows me the following error.

错误

The requested URL could not be retrieved    
The following error was encountered while trying to retrieve the URL: http://localhost:49824/    
Connection to 127.0.0.1 failed.    
The system returned: (111) Connection refused    
The remote host or network may be down. Please try the request again.    
Your cache administrator is webmaster.

我重新构建了解决方案并将 URL 添加到允许的站点.但问题仍然存在.我应该如何解决这个问题?

I have rebuilt the solution and added the url to allowed site. But still the problem persists. How should I solve this problem?

推荐答案

我终于找到了解决方案......很简单

Finally I found the solution ... It's very easy

  1. 转到 LAN 设置(在 Chrome 中:工具 -> 选项 -> 引擎盖下 -> 更改代理设置 -> LAN 设置)

  1. Go to the LAN settings (In Chrome : Tools -> Options -> Under the hood -> Change Proxy setting -> LAN Setting)

将有一个复选框绕过本地地址的代理服务器"

There will be a checkbox for "Bypass proxy server for local address"

勾选复选框.

完成!

在 Mac/Apple 上:Chrome 使用系统首选项排除本地主机:

On Mac/Apple: Chrome uses system preferences for localhost exclusion:

  1. 进入系统偏好设置 ->网络 ->高级 ->代理设置

  1. Go to System Preferences -> Network -> advanced -> Proxy settings

在底部添加localhost",上面写着:忽略这些主机和域的代理设置"(例外情况用逗号分隔)

Add 'localhost' at the bottom where it says: 'ignore proxy settings for these hosts and domains' (Exceptions are separated by a comma)

这篇关于本地主机在 chrome 和 firefox 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆