添加资源http-dns实现
This commit is contained in:
@@ -10,6 +10,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.httpdns.HttpDnsConst;
|
||||
import com.mogo.httpdns.IHttpDnsCallback;
|
||||
import com.mogo.httpdns.IMogoHttpDns;
|
||||
import com.mogo.httpdns.MogoHttpDnsHandler;
|
||||
@@ -76,7 +77,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
WorkThreadHandler.getInstance().post( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
httpDns.getHttpDnsIp( "dnstest.zhidaozhixing.com", false, new IHttpDnsCallback() {
|
||||
httpDns.getHttpDnsIp( "dnstest.zhidaozhixing.com", HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP, false, new IHttpDnsCallback() {
|
||||
@Override
|
||||
public void onParsed( @Nullable String ip ) {
|
||||
StringBuilder sb = new StringBuilder( "httpDns ip:\n" );
|
||||
@@ -100,7 +101,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
WorkThreadHandler.getInstance().post( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
httpDns.getHttpDnsIp( "dzt-city.zhidaozhixing.com", false, new IHttpDnsCallback() {
|
||||
httpDns.getHttpDnsIp( "dzt-city.zhidaozhixing.com", HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP, false, new IHttpDnsCallback() {
|
||||
@Override
|
||||
public void onParsed( @Nullable String ip ) {
|
||||
StringBuilder sb = new StringBuilder( "httpDns ip:\n" );
|
||||
@@ -121,7 +122,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private void renderResponse( ResponseBody body ) {
|
||||
StringBuilder sb = new StringBuilder( "httpDns ip:\n" );
|
||||
String ip = httpDns.getCachedHttpDnsIps( "dnstest.zhidaozhixing.com" );
|
||||
String ip = httpDns.getCachedHttpDnsIps( "dnstest.zhidaozhixing.com", HttpDnsConst.HTTP_DNS_ADDRESS_TYPE_HTTP );
|
||||
sb.append( ip ).append( "\n" );
|
||||
sb.append( "\nserverIp: \n" ).append( body.result.serverIp ).append( "\n" );
|
||||
content.setText( sb.toString() );
|
||||
|
||||
Reference in New Issue
Block a user