【发布时间】:2017-08-15 15:53:12
【问题描述】:
我知道你可以像这样使用Elastica 客户端来做到这一点:
$client = new \Elastica\Client(array(
'host' => 'my host',
'port' => '9200',
'proxy' => 'my proxy'
));
但如果可能的话,我想使用官方客户端。 我已经根据文档here建立了连接。
$hosts = [
[
'host' => 'my host',
'port' => '9200',
'scheme' => 'http',
'user' => 'my user',
'pass' => 'my pass'
]
];
$client = Elasticsearch\ClientBuilder::create()
->setHosts($hosts)
->build();
但是,文档中没有关于如何设置代理的内容。可能吗?
顺便说一句,我见过this question,但是它已经过时并且不适用于当前版本。
【问题讨论】:
标签: php curl elasticsearch guzzle