407需要代理身份验证(Forefront TMG需要授权才能完成请求。拒绝访问Web代理筛选器。)

我开发了一个网站,使用jQuery将Ajax POST发送到PHP服务器。</ p>

虽然从家里的Web浏览器访问它时效果很好,但是当我从我日间工作的公司网络上的Web浏览器访问时,我的一些Ajax请求失败,并且我收到Firebug显示的以下错误: 407 Proxy 需要身份验证(Forefront TMG需要授权才能完成请求。拒绝访问Web代理筛选器。)</ code>。 请注意,Chrome不显示错误但仍然被阻止,IE11也会阻止它,但由于无关的问题,我无法使用开发工具查看该消息(使用jQuery 1.9的MVC 4项目中的jquery.validate.js出错</ a>)。</ p>

我无法修改公司网络上的任何内容,也不想这样做。 我希望修改我的服务器提供的HTML / JavaScript / Headers以消除对请求的阻止,以便其他人不会遇到此问题。</ p>

可以做什么?</ p> \ n </ div>

展开原文

原文

I have developed a website which uses Ajax POST using jQuery to a PHP server.

While it works perfectly when accessed from a web browser at home, some of my Ajax requests fail when accessed from a web browser on my day job's corporate network, and I get the following error shown by Firebug: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ). Note that Chrome does not show the error but it is still blocked, and IE11 blocks it as well but I haven't been able to view the message using Development Tools due to an unrelated issue (Error in jquery.validate.js in MVC 4 Project with jQuery 1.9).

I have no ability to modify anything on the corporate network, nor is it my desire to do so. My desire is to modify the HTML/JavaScript/Headers which my server provides to eliminate blocking of the request so others do not experience this issue.

What can be done?

douba8819
douba8819 尝试运行CNTLM-它重新协商代理身份验证并通过生产力防火墙获取大量内容。
大约 6 年之前 回复
dongli5785
dongli5785 听起来像你的工作机器在ajax运行时没有登录
6 年多之前 回复

1个回答



当您在html或jquery posts
e.g中使用完整的URL地址时会发生这种情况。 </ p>

 <代码>行动= “http://www.example.com/mydir/myfile.php” 
</代码> </ PRE>

尝试更改网址引用,使其不包含网站地址
e.g。</ p>

  action =“/ mydir / myfile.php”
</ code> </ pre>

使用AJAX / jquery
e.g发布时也适用。 下面的代码产生相同的错误</ p>

  var url1 =“http://www.example.com/mydir/myfile.php”; 
$ .post(url1, function(data){alert(data);});
</ code> </ pre>

但此代码不是</ p>

   var dir1 =“/ mydir / myfile.php”; 
$ .post(dir1,function(data){alert(data);});
</ code> </ pre>

请务必注意,当您从完整的URL切换到目录时,必须相对于当前文件目录定义目录。</ p>
</ div>

展开原文

原文

This happens when you are using a complete url address in your html or jquery posts e.g.

action="http://www.example.com/mydir/myfile.php"

Try changing the url reference so that it doesn't include the website address e.g.

action="/mydir/myfile.php"

This also works when posting with AJAX/jquery e.g. the code below produces the same error

var url1="http://www.example.com/mydir/myfile.php";
$.post(url1, function(data){alert(data);});

but this code doesn't

var dir1="/mydir/myfile.php";
$.post(dir1, function(data){alert(data);});

It is important to note that when you switch from the complete urls to the directories, you have to define your directory relative to your current file directory.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐