Fix #65 for naming

This commit is contained in:
nkorange 2018-09-19 19:35:45 +08:00
parent 413512661b
commit 0667224647
2 changed files with 8 additions and 0 deletions

View File

@ -38,6 +38,8 @@ import java.util.concurrent.TimeUnit;
*/ */
public class NamingProxy { public class NamingProxy {
private static final int DEFAULT_SERVER_PORT = 8848;
private String namespace; private String namespace;
private String endpoint; private String endpoint;
@ -282,6 +284,10 @@ public class NamingProxy {
String url; String url;
if (!curServer.contains(UtilAndComs.SERVER_ADDR_IP_SPLITER)) {
curServer = curServer + UtilAndComs.SERVER_ADDR_IP_SPLITER + DEFAULT_SERVER_PORT;
}
url = HttpClient.getPrefix() + curServer + api; url = HttpClient.getPrefix() + curServer + api;
HttpClient.HttpResult result = HttpClient.request(url, headers, params, UtilAndComs.ENCODING, method); HttpClient.HttpResult result = HttpClient.request(url, headers, params, UtilAndComs.ENCODING, method);

View File

@ -43,4 +43,6 @@ public class UtilAndComs {
public static final String NACOS_NAMING_LOG_NAME = "com.alibaba.nacos.naming.log.filename"; public static final String NACOS_NAMING_LOG_NAME = "com.alibaba.nacos.naming.log.filename";
public static final String NACOS_NAMING_LOG_LEVEL = "com.alibaba.nacos.naming.log.level"; public static final String NACOS_NAMING_LOG_LEVEL = "com.alibaba.nacos.naming.log.level";
public static final String SERVER_ADDR_IP_SPLITER = ":";
} }