Giter Site home page Giter Site logo

Comments (4)

zzvv avatar zzvv commented on May 18, 2024 1

2017-05-28 at 10 15

找到原因了,如图. 我在勾选了alfred的代理设置后,手贱点开Setting后又手动指定了一个本地代理地址,诸如:0.0.0.0:6197,就全部失效掉。- -

from youdaotranslator.

wensonsmith avatar wensonsmith commented on May 18, 2024

看这个样子是你机器的代理出错了, 不是 alfred 的问题。

from youdaotranslator.

zzvv avatar zzvv commented on May 18, 2024

Hi, 抱歉再次打扰到您。

  /**
     * 组装请求地址
     * @return String
     */
    private function getQueryUrl($query)
    {
        $api = 'http://fanyi.youdao.com/openapi.do?type=data&doctype=json&version=1.1&';

        $key = $this->keys[array_rand($this->keys)];
        $key['q'] = $query;
        return $api.http_build_query($key);
    }

我看了下源文件,其中有这么一段定义请求相关信息的地方。
抱歉不会php,我猜最后句应该是发起请求的。
不知道是否是其中哪个参数可以自定义下发起请求的ip:port
alfred 本身的代理我也是有配置的,但不是127.0.0.1:80
所以我猜是不是php中如果没有指定发起HTTP请求的端口,默认就直接走了本机的80端口去请求?

from youdaotranslator.

wensonsmith avatar wensonsmith commented on May 18, 2024

你贴出来的函数只是组装了一个地址, 然后是用的 curl 去请求这个地址。

现在请求这个地址的时候,自动跑到了 127.0.0.1:80 , 说明Surge 已经把代理拿过去了。

alfred 已经走到代理这里了。 我没用过 Surge , 感觉应该是 Surge 规则设置的有问题。 你可以去 Surge 论坛群组里去问一问。

from youdaotranslator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.