【问题标题】:html2canvas with Proxy带代理的 html2canvas
【发布时间】:2014-07-19 14:50:04
【问题描述】:

我有一个页面使用http://html2canvas.hertzen.com/ 在 div 中复制图像。这很好用。当我将外部图像加载到我添加代理的 div 中时,这不起作用。在我的代码中,我只需添加“代理:”/two2/php/proxy.php“,”:

$('.Canvas').html2canvas({
    //logging:true,
    proxy: "/two2/php/proxy.php",
    onrendered: function (canvas) {

然后我将 php https://github.com/brcontainer/html2canvas-php-proxy/blob/master/html2canvasproxy.php 上传到该文件夹​​“/two2/php/”。

我还需要做些什么来让它工作吗?

谢谢。

【问题讨论】:

  • 代理不应该有完整的url吗?
  • 它肯定会得到 proxy.php 文件我有一个我从代码中删除的 var:proxy: myURL+"/two2/php/proxy.php",
  • 我在回复中确实得到了这个: html2canvas_1("error: html2canvas-proxy-php: 执行时间没有配置到 SOCKET 中的 TIMEOUT,请使用 ini_set\/set_time_limit 或 \"php 进行配置.ini\"(如果启用了安全模式),建议将 \"max_execution_time =;\" 至少延长 5 秒或减少 \"define('TIMEOUT', 30);\"");
  • 虽然我已经从define('TIMEOUT', 30);//从加载Socket超时到define('TIMEOUT', 3000);//从加载Socket超时,仍然得到那个响应?

标签: javascript php proxy html2canvas


【解决方案1】:

在 PHP 中,我增加了 TIMEOUT,我应该减少了。原来是

define('TIMEOUT', 30);//Timeout from load Socket

我改成

define('TIMEOUT', 10);//Timeout from load Socket

现在可以了

【讨论】:

    猜你喜欢
    • 2016-01-18
    • 2012-04-07
    • 2013-01-05
    • 1970-01-01
    • 2018-05-11
    • 1970-01-01
    • 2018-09-25
    • 1970-01-01
    • 2021-10-10
    相关资源
    最近更新 更多