Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webmagic
Project
Project
Details
Activity
Releases
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
沈俊林
webmagic
Commits
b871b210
Commit
b871b210
authored
May 08, 2016
by
yihua.huang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'proxy-strategy' of github.com:EdwardsBean/webmagic into EdwardsBean-proxy-strategy
parents
b5413368
19474e47
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
320 additions
and
312 deletions
+320
-312
Site.java
webmagic-core/src/main/java/us/codecraft/webmagic/Site.java
+5
-9
ProxyPool.java
.../src/main/java/us/codecraft/webmagic/proxy/ProxyPool.java
+5
-303
SimpleProxyPool.java
...ain/java/us/codecraft/webmagic/proxy/SimpleProxyPool.java
+310
-0
No files found.
webmagic-core/src/main/java/us/codecraft/webmagic/Site.java
View file @
b871b210
...
...
@@ -5,6 +5,7 @@ import com.google.common.collect.Table;
import
org.apache.http.HttpHost
;
import
us.codecraft.webmagic.proxy.Proxy
;
import
us.codecraft.webmagic.proxy.SimpleProxyPool
;
import
us.codecraft.webmagic.proxy.ProxyPool
;
import
us.codecraft.webmagic.utils.UrlUtils
;
...
...
@@ -470,18 +471,18 @@ public class Site {
* @param httpProxyList httpProxyList
* @return this
*/
public
Site
setHttpProxyPool
(
List
<
String
[]>
httpProxyList
)
{
this
.
httpProxyPool
=
new
ProxyPool
(
httpProxyList
)
;
public
Site
setHttpProxyPool
(
ProxyPool
proxyPool
)
{
this
.
httpProxyPool
=
proxyPool
;
return
this
;
}
public
Site
setHttpProxyPool
(
List
<
String
[]>
httpProxyList
,
boolean
isUseLastProxy
)
{
this
.
httpProxyPool
=
new
ProxyPool
(
httpProxyList
,
isUseLastProxy
);
this
.
httpProxyPool
=
new
Simple
ProxyPool
(
httpProxyList
,
isUseLastProxy
);
return
this
;
}
public
Site
enableHttpProxyPool
()
{
this
.
httpProxyPool
=
new
ProxyPool
();
this
.
httpProxyPool
=
new
Simple
ProxyPool
();
return
this
;
}
...
...
@@ -497,9 +498,4 @@ public class Site {
httpProxyPool
.
returnProxy
(
proxy
,
statusCode
);
}
public
Site
setProxyReuseInterval
(
int
reuseInterval
)
{
this
.
httpProxyPool
.
setReuseInterval
(
reuseInterval
);
return
this
;
}
}
webmagic-core/src/main/java/us/codecraft/webmagic/proxy/ProxyPool.java
View file @
b871b210
This diff is collapsed.
Click to expand it.
webmagic-core/src/main/java/us/codecraft/webmagic/proxy/SimpleProxyPool.java
0 → 100644
View file @
b871b210
This diff is collapsed.
Click to expand it.
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