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
6ed3ae61
Commit
6ed3ae61
authored
May 13, 2020
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release
parent
17eb5a06
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Trans.java
...ain/java/com/edgec/browserbackend/common/utils/Trans.java
+7
-5
No files found.
src/main/java/com/edgec/browserbackend/common/utils/Trans.java
View file @
6ed3ae61
package
com
.
edgec
.
browserbackend
.
common
.
utils
;
package
com
.
edgec
.
browserbackend
.
common
.
utils
;
import
com.edgec.browserbackend.common.commons.utils.NotifyUtils
;
import
com.edgec.browserbackend.common.commons.utils.NotifyUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpHost
;
import
org.apache.http.HttpHost
;
...
@@ -43,6 +44,7 @@ public class Trans {
...
@@ -43,6 +44,7 @@ public class Trans {
/**
/**
* 主入口方法
* 主入口方法
*
* @param args
* @param args
*/
*/
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
@@ -56,7 +58,7 @@ public class Trans {
...
@@ -56,7 +58,7 @@ public class Trans {
httpClient
.
getCredentialsProvider
().
setCredentials
(
httpClient
.
getCredentialsProvider
().
setCredentials
(
new
AuthScope
(
host
,
port
),
new
AuthScope
(
host
,
port
),
new
UsernamePasswordCredentials
(
username
,
password
));
new
UsernamePasswordCredentials
(
username
,
password
));
HttpHost
proxy
=
new
HttpHost
(
host
,
port
);
HttpHost
proxy
=
new
HttpHost
(
host
,
port
);
httpClient
.
getParams
().
setParameter
(
ConnRouteParams
.
DEFAULT_PROXY
,
proxy
);
httpClient
.
getParams
().
setParameter
(
ConnRouteParams
.
DEFAULT_PROXY
,
proxy
);
return
httpClient
;
return
httpClient
;
}
}
...
@@ -76,13 +78,11 @@ public class Trans {
...
@@ -76,13 +78,11 @@ public class Trans {
HttpEntity
entry
=
response
.
getEntity
();
HttpEntity
entry
=
response
.
getEntity
();
if
(
entry
!=
null
)
if
(
entry
!=
null
)
{
{
InputStreamReader
is
=
new
InputStreamReader
(
entry
.
getContent
());
InputStreamReader
is
=
new
InputStreamReader
(
entry
.
getContent
());
BufferedReader
br
=
new
BufferedReader
(
is
);
BufferedReader
br
=
new
BufferedReader
(
is
);
String
str
=
null
;
String
str
=
null
;
while
((
str
=
br
.
readLine
())
!=
null
)
while
((
str
=
br
.
readLine
())
!=
null
)
{
{
sb
.
append
(
str
.
trim
());
sb
.
append
(
str
.
trim
());
}
}
br
.
close
();
br
.
close
();
...
@@ -96,6 +96,8 @@ public class Trans {
...
@@ -96,6 +96,8 @@ public class Trans {
NotifyUtils
.
sendMessage
(
"防关联浏览器 ip "
+
host
+
" 代理异常"
,
e
,
NotifyUtils
.
MsgType
.
WEBHOOK
);
NotifyUtils
.
sendMessage
(
"防关联浏览器 ip "
+
host
+
" 代理异常"
,
e
,
NotifyUtils
.
MsgType
.
WEBHOOK
);
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
return
""
;
return
""
;
}
finally
{
httpGet
.
releaseConnection
();
}
}
return
sb
.
toString
();
return
sb
.
toString
();
}
}
...
...
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