从代理后面使用 BugzScout.net 时遇到困难

发布于 2024-07-16 06:15:50 字数 1511 浏览 13 评论 0原文

我正在尝试使用 Fogbugz 的 BugzScout 来自动将无人处理的应用程序异常提交到我的 Fogbugz 按需帐户。 我已经为它编写了一个包装类,并且在我的盒子上一切似乎都很美妙。 在生产环境中测试相同的代码,在需要身份验证的代理后面,除了问题之外什么也没有。

我开始修改 BugzScout 代码,以便让它通过代理进行身份验证,在尝试了通过 Google 搜索建议的许多不同方法后,找到了一种有效的方法! 但现在我从 Fogbugz 本身收到“连接主动拒绝”错误,我不知道该怎么办。

下面是 BugzScout 通过 .net WebClient 连接以提交新案例的代码,我进行了修改以处理我们的代理。 我做了什么会导致 Fogbugz 拒绝我的请求? 为了便于阅读,我已从该过程中删除了所有非 Web 客户端相关的代码。

public string Submit(){         
        WebClient client = new WebClient();
        WebProxy proxy = new WebProxy();
        proxy.UseDefaultCredentials = true;            
        client.Proxy = proxy;            
        Byte[] response = client.DownloadData(fogBugzUrl);
        string responseText = System.Text.Encoding.UTF8.GetString(response);
        return (responseText == "") ? this.defaultMsg : responseText;
    }

网址正确并且案例填写正确 - 这已经过验证。

编辑:附加信息。

  • 使用 Fogbugz 点播。
  • 完整使用 FogBugz.net 代码,仅添加这些内容
       WebProxy proxy = new WebProxy();
       proxy.UseDefaultCredentials = true;            
       client.Proxy = proxy;

I'm attempting to use Fogbugz's BugzScout in order to automatically submit unhanded application exceptions to my Fogbugz on demand Account. I've written up a wrapper class for it and everything appears to be just groovy - on my box. Testing the same code in the production environment, behind a Proxy that requires authentication, I have had nothing but issues.

I went to work modifying the BugzScout code in order to get it to authenticate with the Proxy, and after trying many different methods suggested via a Google search, found one that works! But now I'm getting an "Connection actively refused" error from Fogbugz itself, and I don't know what to do.

Here is the code where the BugzScout connects via a .net WebClient to submit a new case, with my modifications to deal with our Proxy. What am I doing that would cause Fogbugz to refuse my request? I've removed all non web-client related code from the procedure for ease of reading.

public string Submit(){         
        WebClient client = new WebClient();
        WebProxy proxy = new WebProxy();
        proxy.UseDefaultCredentials = true;            
        client.Proxy = proxy;            
        Byte[] response = client.DownloadData(fogBugzUrl);
        string responseText = System.Text.Encoding.UTF8.GetString(response);
        return (responseText == "") ? this.defaultMsg : responseText;
    }

The url is correct and the case is filled in properly- this has been verified.

EDIT: Additional info.

  • Using Fogbugz on Demand.
  • Using FogBugz.net code in it's entirety, with only these additions
       WebProxy proxy = new WebProxy();
       proxy.UseDefaultCredentials = true;            
       client.Proxy = proxy;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

或十年 2024-07-23 06:15:50

从 Fogbugz 获得修复 - 这是通过代理身份验证并且不会使用 Bugzscout 进行错误身份验证的适当网络代码。

WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
WebRequest request = WebRequest.Create(fogBugzUrl);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;     
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();

Got the fix from Fogbugz- this is the appropriate network code to get though the proxy authentication and not mis-authenticate with Bugzscout.

WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
WebRequest request = WebRequest.Create(fogBugzUrl);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;     
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
情感失落者 2024-07-23 06:15:50

您的fogbugzUrl 是否使用HTTP 基本身份验证? 是 SSL(按需托管吗?)

连接主动拒绝消息将来自 Web 服务器本身,而不是真正的 FogBugz。

你能发布 HTTP 状态代码吗?

如果您使用 FogBugz On Demand,需要注意的一件事是您必须使用 https:// url(而不是 http url)。

Is your fogbugzUrl using HTTP Basic Authentication? Is it SSL (hosted on On Demand?)

The connection actively refused message would be coming from the web server itself, not really FogBugz.

Can you post the HTTP Status Code?

One thing to note if you are using FogBugz On Demand is you HAVE to use the https:// url (not the http url).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文