0

我有一个 CasperJS 脚本 duolingo.js,我使用 MeteorJS 应用程序使用 Meteor 方法运行脚本,如下所示:

// define server methods so that the clients will have access to server components
Meteor.methods({
  runCasperJS: function() {
    // This method call won't return immediately, it will wait for the
    // asynchronous code to finish, so we call unblock to allow this client
    // to queue other method calls (see Meteor docs)
    this.unblock();
    // run synchonous system command
    var result = process_exec_sync('casperjs duolingo.js --engine=slimerjs --disk-cache=no --proxy=178.166.41.225:80 --proxy-type=HTTP');
    // check for error
    if (result.error) {
      throw new Meteor.Error("exec-fail", "Error running CasperJS: " + result.error.message);
    }
    // success
    return true;
  }
});

我需要使用代理 IP V6 运行 CasperJS 实例。但我没有任何想法,slimerjs 和 casperjs 的官方文档并没有说什么。这是我使用 IP V4 代理的代码的确切部分。

  var result = process_exec_sync('casperjs duolingo.js 
--engine=slimerjs --disk-cache=no --proxy=178.166.41.225:80 
--proxy-type=HTTP');

感谢您的时间和帮助。

4

0 回答 0