Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
01c65e6e
Commit
01c65e6e
authored
Apr 21, 2015
by
أحمد المحمودي (Ahmed El-Mahmoudy)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If using SOCKS5 proxy, then resolve server hostname remotely at the proxy
parent
d3ee174d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
+34
-5
ConnectionThread.java
.../com/xabber/android/data/connection/ConnectionThread.java
+34
-5
No files found.
app/src/main/java/com/xabber/android/data/connection/ConnectionThread.java
View file @
01c65e6e
...
...
@@ -190,15 +190,25 @@ public class ConnectionThread implements
runOnConnectionThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
addressResolve
(
null
,
defaultHost
,
defaultPort
,
true
);
if
(
proxyType
==
ProxyType
.
socks5
)
{
onReady
(
defaultHost
,
defaultPort
);
}
else
{
addressResolve
(
null
,
defaultHost
,
defaultPort
,
true
);
}
}
});
}
else
{
runOnConnectionThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
addressResolve
(
fqdn
,
target
.
getHost
(),
target
.
getPort
(),
true
);
if
(
proxyType
==
ProxyType
.
socks5
)
{
onReady
(
target
.
getHost
(),
target
.
getPort
());
}
else
{
addressResolve
(
fqdn
,
target
.
getHost
(),
target
.
getPort
(),
true
);
}
}
});
}
...
...
@@ -284,6 +294,19 @@ public class ConnectionThread implements
proxyUser
,
proxyPassword
);
ConnectionConfiguration
connectionConfiguration
=
new
ConnectionConfiguration
(
address
.
getHostAddress
(),
port
,
serverName
,
proxy
);
onReady
(
connectionConfiguration
);
}
private
void
onReady
(
final
String
host
,
final
int
port
)
{
LogManager
.
i
(
this
,
"Use remote DNS for "
+
host
);
ProxyInfo
proxy
=
proxyType
.
getProxyInfo
(
proxyHost
,
proxyPort
,
proxyUser
,
proxyPassword
);
ConnectionConfiguration
connectionConfiguration
=
new
ConnectionConfiguration
(
host
,
port
,
serverName
,
proxy
);
onReady
(
connectionConfiguration
);
}
private
void
onReady
(
ConnectionConfiguration
connectionConfiguration
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
14
)
{
connectionConfiguration
.
setTruststoreType
(
"AndroidCAStore"
);
connectionConfiguration
.
setTruststorePassword
(
null
);
...
...
@@ -680,8 +703,14 @@ public class ConnectionThread implements
public
void
run
()
{
if
(
useSRVLookup
)
srvResolve
(
fqdn
,
fqdn
,
port
);
else
addressResolve
(
null
,
fqdn
,
port
,
true
);
else
{
if
(
proxyType
==
ProxyType
.
socks5
)
{
onReady
(
fqdn
,
port
);
}
else
{
addressResolve
(
null
,
fqdn
,
port
,
true
);
}
}
}
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment