How is it right to build FoxyProxy for localhost?



  • There's been a mistake. http://prntscr.com/9m1pwu that I can't decide. That I use the server - node js The simplest server in which the request processors are my piece of code.

    var taskpath = __dirname + '/public/task.json';
    app.post('/task',function(req, res){
     var readable = fs.createReadStream(taskpath);
     readable.pipe(res);
    });
    

    client https://addons.mozilla.org/ru/firefox/addon/greasemonkey/ Example of violin:

    $(document).ready(function() {
    var t = {};
    GM_xmlhttpRequest({
      method: 'POST',
      url: 'http://localhost:7575/task',
      onload: function(data) {
        var json_text = JSON.stringify(data.response, null, 2),
          your_object = JSON.parse(json_text);
    
    var href = $('#guide-channels').find('li:contains(' + your_object[0].task[0].channel + ')').find('a').attr('href'),
      videos = 'http://www.youtube.com' + href + '/videos',
      channel = {};
      channel['channel'] = videos;
    GM_xmlhttpRequest({
      method: 'POST',
      data: JSON.stringify(channel),
      contentType: 'application/json',
      url: 'http://localhost:8081/getHttp',
      onload: function(xhr) {
        console.log('xhr__', xhr.responseText);
      }
    });
    

    }
    });
    });

    without proxy, everything works, with a proxy set, there's a mistake.
    I think I need a building I don't know. How do you get proxy and localhost?

    Tell me where to dig.



  • I understand FoxyProxy, it's just a switch between proxy servers. It's not a proxy server. Judging by an error in the scream, the request goes to localhost:8081, waiting for a proxy server, and it's not installed, or the port of 8081 is closed by a firewall.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2