本文整理汇总了C#中Fiddler.Session.HostnameIs方法的典型用法代码示例。如果您正苦于以下问题:C# Session.HostnameIs方法的具体用法?C# Session.HostnameIs怎么用?C# Session.HostnameIs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fiddler.Session
的用法示例。
在下文中一共展示了Session.HostnameIs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InterceptRequest
private void InterceptRequest(Session session)
{
if (!session.hostname.EndsWith(s3Configuration.ServiceUrl))
{
return;
}
if (session.HTTPMethodIs("CONNECT"))
{
session.oFlags["x-replywithtunnel"] = "fake tunnel";
return;
}
string bucket = string.Empty;
if (!session.HostnameIs(s3Configuration.ServiceUrl))
{
string virtualHostedPath = session.hostname.Replace("." + s3Configuration.ServiceUrl, string.Empty);
bucket = "/" + virtualHostedPath;
}
if(session.isHTTPS)
{
session.fullUrl = session.fullUrl.Replace("https", "http");
}
session.host = string.Format("127.0.0.1:{0}", s3Configuration.HostPort);
session.PathAndQuery = string.Format("{0}{1}", bucket, session.PathAndQuery);
}
示例2: AutoTamperRequestBefore
public void AutoTamperRequestBefore(Session oSession)
{
// http:443 프로토콜 체크
if (PLinkCore.PLink.host.isHttpsFilter) { checkHttpsFilter(oSession); }
// api 모드 적용
if (oSession.HostnameIs("api.plink")) {
runApiMode(oSession);
return;
}
// PLink host 변조 적용
if (PLinkCore.PLink.host.StartState) {
checkHost(oSession);
}
}
示例3: AutoTamperRequestBefore
public void AutoTamperRequestBefore(Session session)
{
if (Settings.enabled && session.HostnameIs(reportHost) && !session.isFTP)
{
// TODO: We should offer an option to hide the reports from Fiddler; change "ui-strikeout" to "ui-hide" in the next line
session["ui-strikeout"] = "CSPReportGenerator";
if (!session.HTTPMethodIs("CONNECT"))
{
session.utilCreateResponseAndBypassServer();
session.oResponse.headers.Add("Content-Type", "text/html");
session.ResponseBody = Encoding.UTF8.GetBytes("<!doctype html><HTML><BODY><H1>Report received.</H1></BODY></HTML>");
ProcessCSPReport(session);
}
else
{
session["x-replywithtunnel"] = "CSPReportGenerator";
}
}
}
示例4: OnFiddlerSessionComplete
void OnFiddlerSessionComplete(Session oSession)
{
if (configuration == null || !configuration.HostsToIntercept.Any(host => oSession.HostnameIs(host)))
{
return;
}
lock (sessionsLock)
{
sessions.Add(oSession);
}
var session = new FiddlerHttpSession(oSession);
OnSessionComplete?.Invoke(this, new HttpSessionCompleteEventArgs(session));
}
示例5: AutoTamperRequestBefore
public void AutoTamperRequestBefore(Session oSession)
{
// 캐쉬 적용하지 않기
if (disabledCache){ SetDiabledCache(oSession); }
// http:443 프로토콜 체크
if (PLinkCore.PLink.host.isHttpsFilter) { checkHttpsFilter(oSession); }
log(getSessionString(oSession));
// api 모드 적용
if (oSession.HostnameIs("api.plink")) {
runApiMode(oSession);
return;
}
// PLink host 변조 적용
if (PLinkCore.PLink.host.StartState) {
checkHost(oSession);
}
log(oSession.fullUrl);
}