Added optional configuration url for nacos which used to request nacos server. (#3211)

Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
刀刀 2021-01-28 12:02:54 +08:00 committed by GitHub
parent 1f40236e35
commit 7d32ef4780
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,7 @@
## Added
- [#3211](https://github.com/hyperf/hyperf/pull/3211) Added optional configuration url for nacos which used to request nacos server.
- [#3214](https://github.com/hyperf/hyperf/pull/3214) Added Caller which help you to use instance in coroutine security mode.
## Changed

View File

@ -13,6 +13,8 @@ use Hyperf\Nacos\Constants;
return [
'enable' => true,
// nacos server url like https://nacos.hyperf.io, Priority is higher than host:port
// 'url' => '',
// The nacos host info
'host' => '127.0.0.1',
'port' => 8848,

View File

@ -52,6 +52,12 @@ abstract class AbstractNacos
public function getServerUri(): string
{
$url = $this->config->get('nacos.url');
if ($url) {
return $url;
}
return sprintf(
'%s:%d',
$this->config->get('nacos.host', '127.0.0.1'),