2018年08月11日 16:29 阅读量:3162
目前市面腾讯管家域名检测都是采用https://guanjia.qq.com/online_server/webindex.html
这个检测的结果在qq聊天窗口打开显示不准确,很多在qq里面无法打开的,检测结果都是未知,
请求
GET https://cgi.urlsec.qq.com/index.php?m=check&a=gw_check&callback=jQuery1113037438054305660823_1588148105874&url=http%3A%2F%2Fxqjqiao.com&_=1588148105875 HTTP/1.1
Accept: application/javascript, */*;q=0.8
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Host: cgi.urlsec.qq.com
Connection: Keep-Alive
Cookie: pgv_pvi=4990390272; pgv_si=s2426491904; pgv_info=ssid=s5999697878; pgv_pvid=5641581224
结果
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 29 Apr 2020 08:15:04 GMT
Content-Type: text/javascript;charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/5.5.5
Content-Length: 238
jQuery1113037438054305660823_1588148105874({"data":{"retcode":0,"results":{"url":"http:\/\/xqjqiao.com","whitetype":1,"WordingTitle":"","Wording":"","detect_time":"1578463084","eviltype":"2804","certify":0,"isDomainICPOk":0}},"reCode":0})
下面这个接口是市面上腾讯管家域名检测比较准的http://wx.rrbay.com/pro/qqUrlCheck.ashx?url=www.xqjqiao.com
,大家可以自行测试。
public void ProcessRequest(HttpContext context)
{
//正式用
userIP = GetWebClientIp(context);
string urlCheck = string.Empty;
context.Response.ContentType = "text/plain";
string result = string.Empty;
if (!string.IsNullOrEmpty(context.Request["url"]) && !string.IsNullOrEmpty(context.Request["key"]) && context.Request["key"].Length == 32)
{
string userKey = context.Request["key"]; //key ,md5值
if (userKey.Trim() == wxCheckApiKey)
{
result = "{\"State\":false,\"Code\",\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,进qq群交流:41977413!\"}";
}
else
{
ServiceApiClient SpVoiceObj2 = null;
// ServiceApiClient SpVoiceObj = null;
try
{
//需要检测的网址
urlCheck = context.Request["url"]; //检测的值
bool isTrue = urlCheck.StartsWith("http");
if (!isTrue) { urlCheck = "http://" + urlCheck; }
urlCheck = System.Web.HttpUtility.UrlEncode(urlCheck);
string json2 = "{\"Mode\":\"AuthQQKey\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
SpVoiceObj2 = new ServiceApiClient("NetTcpBinding_IServiceApi");
SpVoiceObj2.Open();
result = SpVoiceObj2.Api(json2);
SpVoiceObj2.Close();
////JsonObject.Results aup = JsonConvert.DeserializeObject<JsonObject.Results>(result);
////if (aup.State == true)
////{
//// string json = "{\"Mode\":\"WXCheckUrl\",\"Param\":\"{\'CheckUrl\':\'" + urlCheck + "\',\'UserKey\':\'" + userKey + "\'}\"}";
//// SpVoiceObj = new ServiceApiClient("NetTcpBinding_IServiceApi");
//// SpVoiceObj.Open();
//// result = SpVoiceObj.Api(json);
//// SpVoiceObj.Close();
////}
if (!string.IsNullOrEmpty(context.Request.QueryString["callback"]))
{
string callBack = context.Request.QueryString["callback"].ToString(); //回调
result = callBack + "(" + result + ")";
}
}
catch (System.ServiceModel.CommunicationException)
{
// if (SpVoiceObj != null) SpVoiceObj.Abort();
if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
}
catch (TimeoutException)
{
// if (SpVoiceObj != null) SpVoiceObj.Abort();
if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
}
catch (Exception ex)
{
// if (SpVoiceObj != null) SpVoiceObj.Abort();
if (SpVoiceObj2 != null) SpVoiceObj2.Abort();
result = "{\"State\":false,\"Code\",\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"请求操作在配置的超时,请联系管理员!\"}";
LogTools.WriteLine(userIP + ":" + userKey + ":" + ex.Message);
}
}
}
else
{
result = "{\"State\":false,\"Code\",\"003\",\"Data\":\"" + urlCheck + "\",\"Msg\":\"参数错误,进qq群交流:41977413!\"}";
}
context.Response.Write(result);
context.Response.End();
}