简体   繁体   English

监控外部网站的HTTP请求

[英]monitor HTTP requests of external website

I want to write a script generator based on whats happening on the website, and for that I have written javascript - ajax based script generator, where on every page i do include the js file and within function block of page where page is submited I call the function of javascript to initiate reading of page variables ( DOM ) by getElementsByTagName(*), and after looping through it, I write predefined format to a file using ajax. 我想编写一个基于网站上发生的事情的脚本生成器,为此,我编写了javascript-基于ajax的脚本生成器,其中每个页面上都包含js文件,并且在页面提交页面的功能块中,我称之为javascript的功能,以通过getElementsByTagName(*)启动页面变量(DOM)的读取,并在循环浏览之后,使用ajax将预定义格式写入文件。

this all is done for the same site where its running, however now as when I needed to implement same for any other site as recorder and script generator as whats done on the website and to log into file, neither I can include my script on to any other external website nor put function call before submit to read dom and throw into file. 所有这些操作都是针对运行该站点的同一站点完成的,但是现在,当我需要对其他任何站点(如记录器和脚本生成器)实施相同的操作时,就像在网站上所做的并登录文件一样,我都无法将我的脚本包含在其中在提交读取dom并将其放入文件之前,任何其他外部网站也未放置函数调用。

here is dummy code of js 这是js的伪代码

 beginRecording();

function beginRecording()
{
    if(RECORD_BIT == 1)
    { 
       processPageData();   
    }
}

function processPageData()
{
  var i
  var obj = document
  var posArray = new Array();
  var allElement = obj.getElementsByTagName("*");
  var dataArrayString = "";

  for(i=0; i < allElement.length; i++)
  {
    if (allElement[i].getAttribute('id') != null && allElement[i].getAttribute('id') != "") 
    {
        posArray[posArray.length] = allElement[i].getAttribute('id');
    }
 }

 for(i = 0 ; i < posArray.length ; i++)
 {
    dataArrayString = dataArrayString+"SET  "+posArray[i]+"="+getValueFromPage(posArray[i]);
 }



  writePostData(dataArrayString);

}

The function writePostData, does ajax and writes/ updates file on the server by logging what was on DOM element, and I send couple of more details liek GET/POST or page name and so on.. 函数writePostData,通过记录DOM元素上的内容来执行ajax并在服务器上写入/更新文件,然后发送一些其他详细信息,例如GET / POST或页面名称等。

beginRecording() is called on the page before javascript does a submit as document.forms[0].submit(), so that it can capture POST. 在javascript将文档作为document.forms [0] .submit()提交之前,将在页面上调用beginRecording(),以便它可以捕获POST。

I read about cross domain ajax, but still I am not sure how can I monitor HTTP (read GET / POST and data on page or URL) of any external website without adding my script into that file, and write to file 我阅读了有关跨域Ajax的文章,但是仍然不确定如何监视任何外部网站的HTTP(读取GET / POST和页面或URL上的数据)而不将我的脚本添加到该文件中并写入该文件

any help or direction would be great. 任何帮助或指示都会很棒。

您不能将javascript包含在远程站点上,也不能监视它的HTTP请求,这两项都会对安全性造成灾难性的影响...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 外部网站上的好友请求不起作用 - Friends requests on external website not working 网站如何知道我的笔记本电脑已连接到外接显示器? - How does a website know my laptop is connected to an external monitor? 如何满足网站上的HTTP和HTTPS请求? - How to cater HTTP and HTTPS requests on a website? 单元测试控制器功能在NodeJS中发出外部HTTP请求 - Unit testing controller functions making external HTTP requests in NodeJS 如何在NestJS中记录所有Axios外部HTTP请求 - How to log all Axios external http requests in NestJS $ http提供程序向Github API发出外部请求,但不向Google Map API发送外部请求 - $http provider makes external requests to Github API, but not Google map API 我将如何监控来自站点的所有 http 请求 [Chrome 扩展程序] - How would I monitor all http requests coming from a site [Chrome Extension] 在使用SSL的网站上通过HTTP加载外部JavaScript文件 - Loading external JavaScript files over HTTP on website that uses SSL 在iframe中加载外部网站,但不发送HTTP_REFERER - Load external website in iframe but without sending HTTP_REFERER 如何监视扩展/附加请求? - How to monitor extension/addon requests?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM