Dr.*_*YSG 46 proxy ntlm fiddler wcf-security visual-studio
我遇到Visual Studio 2013和我们的公司代理问题(登录不起作用,更新不起作用,Visual Studio库不起作用,nuget和git失败).所有这些都在做http或https请求.(例如http://visualstudiogallery.msdn.microsoft.com/).在VS2013中,我只是获得了旋转进度条或没有网络连接的消息.
浏览器(chrome,IE,firefox)没问题,因为他们都理解代理(407拒绝,然后用凭据回复).
所以我想弄明白为什么VS2013不起作用.但是当我告诉fiddler2观看DEVENV.EXE进程(或所有进程)时,我看不到任何流量.
顺便说一下,我已经尝试对web.config(devenv.exe.config)文件进行一些更改,以确保它转到代理(我在堆栈生成器中看到了这个),但它对我不起作用.请参阅以下部分的补充内容:
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy proxyaddress="http://gw6.OURSITE.com:3128" />
</defaultProxy>
<settings>
<ipv6 enabled="true"/>
<servicePointManager expect100Continue="false" />
</settings>
</system.net>
Run Code Online (Sandbox Code Playgroud)
埃里克,我接受了你的建议并把它塞进C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config文件中.
我放的是:
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
Run Code Online (Sandbox Code Playgroud)
我发现VS2013没有发送用户代理字符串.它确实知道#407 naks并且它使用凭据进行回复,但网关仍然需要用户代理:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Proxy-Connection: close
Connection: close
Content-Length: 1341
<html>
<head>
<title>Access Policy Denied: No User-Agent Specified</title>
<meta name="description" content="Web Access Policy">
</head>
<body>
Run Code Online (Sandbox Code Playgroud)
Eri*_*Law 40
如果您想查看Fiddler的流量,您可能想要更改machine.config文件的路径,以便所有.NET应用程序都将通过Fiddler发送流量.这有助于确保从服务中运行的进程中捕获数据等.
machine.config在文件夹中打开C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config.请注意,如果您正在调试64位服务(如ASP.NET),则需要查看该Framework64文件夹而不是Framework文件夹.同样,如果您使用的是4.0之前的.NET版本,则需要调整路径的版本部分.
将以下XML块作为对等方添加到现有的system.net元素,替换任何现有的defaultProxy元素(如果存在):
<!-- The following section is to force use of Fiddler for all applications, including those running in service accounts -->
<system.net>
<defaultProxy
enabled = "true"
useDefaultCredentials = "true">
<proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
</defaultProxy>
</system.net>
Run Code Online (Sandbox Code Playgroud)
参考http://fiddler2.com/blog/blog/2013/01/08/capturing-traffic-from-.net-services-with-fiddler
注意:User-Agent如果您愿意,可以使用Fiddler为出站请求注入标头.此外,在最新版本的Fiddler中,您可以使用文件>导入>数据包捕获来收集使用Microsoft NetMon或Microsoft Message Analyzer捕获的.cap文件的HTTP流量.
小智 14
我的老板建议另一个简单的方法来解决这个问题.你可以在uri中添加"fiddler".例如:http:// localhost:52101 / - > http://localhost.fiddler:52101 /
或者你可以使用轻量级的方式;
if(Debugger.IsAttached){request.Proxy = new WebProxy("
http://localhost:8888/",true); }
| 归档时间: |
|
| 查看次数: |
37549 次 |
| 最近记录: |