Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
browser-backend
Commits
2a2eb699
Commit
2a2eb699
authored
May 19, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ip健康检查增加超时时间
parent
3d35f69e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
BrowserTask.java
...va/com/edgec/browserbackend/browser/task/BrowserTask.java
+17
-13
Trans.java
...ain/java/com/edgec/browserbackend/common/utils/Trans.java
+3
-3
No files found.
src/main/java/com/edgec/browserbackend/browser/task/BrowserTask.java
View file @
2a2eb699
...
...
@@ -348,19 +348,23 @@ public class BrowserTask {
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
url
=
CLOUDAMURL
+
"/ecc/ipinfo?accountId=browser&ip="
+
"100.25.101.201"
;
String
profiles
=
"prod"
;
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Content-Type"
,
"application/json"
);
if
(
profiles
.
equals
(
"dev"
)
||
profiles
.
equals
(
"staging"
))
headers
.
put
(
"Authorization"
,
"Bearer oq5tg3gMsflHcK5iZ2741G5R30XYd9blyOqH9qeBItKtrzfTsGIoy8AsxqqNXdcm"
);
else
if
(
profiles
.
equals
(
"prod"
))
headers
.
put
(
"Authorization"
,
"Bearer tKWsuHzcngf0RQPMss70f9jgymDIwgQ9zbLfESJdcou3pZSNWl7lNTzto8VQgwaO"
);
String
rs
=
HttpClientutils
.
doGet
(
url
,
headers
);
System
.
out
.
println
(
rs
);
IpInfoResultDto
ipInfoResultDto
=
JSONObject
.
parseObject
(
rs
,
IpInfoResultDto
.
class
);
System
.
out
.
println
(
ipInfoResultDto
);
// String url = CLOUDAMURL + "/ecc/ipinfo?accountId=browser&ip=" + "100.25.101.201";
// String profiles = "prod";
// Map<String, String> headers = new HashMap<>();
// headers.put("Content-Type", "application/json");
// if (profiles.equals("dev") || profiles.equals("staging"))
// headers.put("Authorization", "Bearer oq5tg3gMsflHcK5iZ2741G5R30XYd9blyOqH9qeBItKtrzfTsGIoy8AsxqqNXdcm");
// else if (profiles.equals("prod"))
// headers.put("Authorization", "Bearer tKWsuHzcngf0RQPMss70f9jgymDIwgQ9zbLfESJdcou3pZSNWl7lNTzto8VQgwaO");
//
// String rs = HttpClientutils.doGet(url, headers);
// System.out.println(rs);
// IpInfoResultDto ipInfoResultDto = JSONObject.parseObject(rs, IpInfoResultDto.class);
// System.out.println(ipInfoResultDto);
Trans
trans
=
new
Trans
(
"8.208.28.192"
,
"962MrDCCd2pvaA1"
);
String
sp_result
=
trans
.
get
(
"http://pv.sohu.com/cityjson"
);
System
.
out
.
println
(
sp_result
);
}
...
...
src/main/java/com/edgec/browserbackend/common/utils/Trans.java
View file @
2a2eb699
...
...
@@ -71,9 +71,9 @@ public class Trans {
RequestConfig
requestConfig
=
RequestConfig
.
custom
()
.
setProxy
(
proxy
)
.
setConnectTimeout
(
2
000
)
.
setSocketTimeout
(
2
000
)
.
setConnectionRequestTimeout
(
2
000
)
.
setConnectTimeout
(
5
000
)
.
setSocketTimeout
(
5
000
)
.
setConnectionRequestTimeout
(
5
000
)
.
build
();
httpGet
.
setConfig
(
requestConfig
);
...
...
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