修改websocket Host和entrance host
This commit is contained in:
@@ -21,12 +21,6 @@ public class WebSocketConstant {
|
||||
@Keep
|
||||
public static final String PROTOCOL = "ws://";
|
||||
|
||||
private static final String DOMAIN_DEV = "dzt-city.zhidaozhixing.com";
|
||||
private static final String DOMAIN_QA = "dzt-city.zhidaozhixing.com";
|
||||
private static final String DOMAIN_DEMO = "dzt-city.zhidaozhixing.com";
|
||||
@Keep
|
||||
private static final String DOMAIN_RELEASE = "dzt-city.zhidaozhixing.com";
|
||||
|
||||
public static String getSocketServer() {
|
||||
switch (DebugConfig.getNetMode()) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
@@ -41,19 +35,6 @@ public class WebSocketConstant {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDomain(){
|
||||
switch (DebugConfig.getNetMode()) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
return DOMAIN_DEV;
|
||||
case DebugConfig.NET_MODE_QA:
|
||||
return DOMAIN_QA;
|
||||
case DebugConfig.NET_MODE_DEMO:
|
||||
return DOMAIN_DEMO;
|
||||
case DebugConfig.NET_MODE_RELEASE:
|
||||
default:
|
||||
return DOMAIN_RELEASE;
|
||||
}
|
||||
}
|
||||
|
||||
// public static String getSocketPort() {
|
||||
// return PORT;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.base.websocket;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.httpdns.HttpDnsConst;
|
||||
import com.mogo.httpdns.IMogoHttpDns;
|
||||
import com.mogo.httpdns.MogoHttpDnsHandler;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -29,16 +29,16 @@ public class WebSocketDnsManager {
|
||||
public void getHttpDnsIp(WebSocketDns webSocketDns) {
|
||||
this.webSocketDns = webSocketDns;
|
||||
IMogoHttpDns mogoHttpDns = MogoHttpDnsHandler.getHttpDnsApi();
|
||||
ThreadPoolService.execute(() -> mogoHttpDns.getHttpDnsIp(WebSocketConstant.getDomain(), HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_WS,false, ip -> {
|
||||
ThreadPoolService.execute(() -> mogoHttpDns.getHttpDnsIp(HostConst.WEBSOCKET_DOMAIN, HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_WS, false, ip -> {
|
||||
Logger.d(TAG, "getHttpDnsIp ip : " + ip + " , 得到Dns IP,准备回调 初始化webSocket");
|
||||
this.cacheIp = ip;
|
||||
this.webSocketDns.getDnsIp((cacheIp != null ?
|
||||
WebSocketConstant.PROTOCOL + ip + WebSocketConstant.PATH :
|
||||
WebSocketConstant.getSocketServer() + WebSocketConstant.PORT));
|
||||
}));
|
||||
mogoHttpDns.addHttpDnsTtlCallback(WebSocketConstant.getDomain(), HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_WS, () -> {
|
||||
mogoHttpDns.addHttpDnsTtlCallback(HostConst.WEBSOCKET_DOMAIN, HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_WS, () -> {
|
||||
Logger.d(TAG, "ttl callBack ,ready to getCache Dns IP");
|
||||
String dnsCacheIp = mogoHttpDns.getCachedHttpDnsIps(WebSocketConstant.getDomain(),HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_WS);
|
||||
String dnsCacheIp = mogoHttpDns.getCachedHttpDnsIps(HostConst.WEBSOCKET_DOMAIN, HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_WS);
|
||||
if (dnsCacheIp == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user