Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
0eaece7a
Commit
0eaece7a
authored
Mar 04, 2017
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove external IP #1148
parent
96320896
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
+4
-18
mobile/src/main/scala/com/github/shadowsocks/BaseService.scala
...e/src/main/scala/com/github/shadowsocks/BaseService.scala
+4
-18
No files found.
mobile/src/main/scala/com/github/shadowsocks/BaseService.scala
View file @
0eaece7a
...
@@ -135,9 +135,9 @@ trait BaseService extends Service {
...
@@ -135,9 +135,9 @@ trait BaseService extends Service {
case
Some
(
ip
)
=>
util
.
Arrays
.
asList
(
InetAddress
.
getByName
(
ip
))
case
Some
(
ip
)
=>
util
.
Arrays
.
asList
(
InetAddress
.
getByName
(
ip
))
case
_
=>
Dns
.
SYSTEM
.
lookup
(
hostname
)
case
_
=>
Dns
.
SYSTEM
.
lookup
(
hostname
)
})
})
.
connectTimeout
(
5
,
TimeUnit
.
SECONDS
)
.
connectTimeout
(
10
,
TimeUnit
.
SECONDS
)
.
writeTimeout
(
5
,
TimeUnit
.
SECONDS
)
.
writeTimeout
(
10
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
5
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
30
,
TimeUnit
.
SECONDS
)
.
build
()
.
build
()
val
requestBody
=
new
FormBody
.
Builder
()
val
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"sig"
,
sig
)
.
add
(
"sig"
,
sig
)
...
@@ -330,18 +330,6 @@ trait BaseService extends Service {
...
@@ -330,18 +330,6 @@ trait BaseService extends Service {
}
}
protected
final
def
buildOvertureConfig
(
file
:
String
)
:
String
=
{
protected
final
def
buildOvertureConfig
(
file
:
String
)
:
String
=
{
val
url
=
"http://icanhazip.com"
val
client
=
new
OkHttpClient
.
Builder
()
.
connectTimeout
(
10
,
TimeUnit
.
SECONDS
)
.
writeTimeout
(
10
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
30
,
TimeUnit
.
SECONDS
)
.
build
()
val
request
=
new
Request
.
Builder
()
.
url
(
url
)
.
build
()
val
response
=
client
.
newCall
(
request
).
execute
()
val
externalIp
=
if
(
response
.
isSuccessful
)
response
.
body
.
string
.
trim
else
""
val
config
=
new
JSONObject
()
val
config
=
new
JSONObject
()
.
put
(
"BindAddress"
,
":"
+
(
profile
.
localPort
+
53
))
.
put
(
"BindAddress"
,
":"
+
(
profile
.
localPort
+
53
))
.
put
(
"RedirectIPv6Record"
,
true
)
.
put
(
"RedirectIPv6Record"
,
true
)
...
@@ -357,9 +345,7 @@ trait BaseService extends Service {
...
@@ -357,9 +345,7 @@ trait BaseService extends Service {
if
(
edns
)
dns
if
(
edns
)
dns
.
put
(
"Protocol"
,
"tcp"
)
.
put
(
"Protocol"
,
"tcp"
)
.
put
(
"Socks5Address"
,
"127.0.0.1:"
+
profile
.
localPort
)
.
put
(
"Socks5Address"
,
"127.0.0.1:"
+
profile
.
localPort
)
.
put
(
"EDNSClientSubnet"
,
new
JSONObject
()
.
put
(
"EDNSClientSubnet"
,
new
JSONObject
().
put
(
"Policy"
,
"disable"
))
.
put
(
"Policy"
,
"auto"
)
.
put
(
"ExternalIP"
,
externalIp
))
else
dns
else
dns
.
put
(
"Protocol"
,
"udp"
)
.
put
(
"Protocol"
,
"udp"
)
.
put
(
"EDNSClientSubnet"
,
new
JSONObject
().
put
(
"Policy"
,
"disable"
))
.
put
(
"EDNSClientSubnet"
,
new
JSONObject
().
put
(
"Policy"
,
"disable"
))
...
...
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