MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / openJabberStream

Method openJabberStream

src/main/java/xmpp/Account.java:62–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 }
61
62 public JabberStream openJabberStream() throws java.io.IOException {
63 String proxy = null;
64 String host = JID.getServer();
65 int tempPort = port;
66 boolean resolveHostname = true;
67 if (hostAddr != null && hostAddr.length() > 0) {
68 host = hostAddr;
69 resolveHostname = false;
70 }
71 if (proxyHostAddr == null || proxyHostAddr.isEmpty()) {
72 proxyHostAddr = System.getProperty("http.proxyHost");
73 proxyPort = Integer.getInteger("http.proxyPort", 1081);
74 }
75 if (resolveHostname) {
76 DnsSrvResolver dns = new DnsSrvResolver();
77 if (dns.getSrv(JID.getServer())) {
78 host = dns.getHost();
79 tempPort = dns.getPort();
80 }
81 }
82
83 if (isEnableProxy()) {
84 proxy = proxyHostAddr;
85 }
86 return new JabberStream(JID.getServer(), host, tempPort, proxy, proxyPort);
87 }
88 public boolean isEnableProxy() {
89 return enableProxy;
90 }

Callers 1

startConnectionMethod · 0.80

Calls 7

getSrvMethod · 0.95
getHostMethod · 0.95
getPortMethod · 0.95
isEnableProxyMethod · 0.95
getServerMethod · 0.80
getPropertyMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected