@@ -44,7 +44,8 @@ or from file
44
44
proxy = ProxyManager ::Proxy .new (' proxies.txt' )
45
45
```
46
46
47
- Files ` proxies.txt ` and ` bad_proxies.txt ` should be writable.
47
+ File with proxy list (in this case ` proxies.txt ` ) should be readable and
48
+ writable.
48
49
Example of ` proxies.txt ` content:
49
50
50
51
```
@@ -55,34 +56,60 @@ Example of `proxies.txt` content:
55
56
56
57
### Get proxy
57
58
58
- Get one proxy
59
+ There is two methods to get proxy.
60
+
61
+ First method return just next proxy, without any checking for availability:
59
62
60
63
``` ruby
61
64
proxy.get
62
65
# => ["127.0.0.1", 80]
63
66
```
64
67
65
- Get many proxies
68
+ Band method return ** only HTTP-available proxy** . It's perfect if you don't
69
+ realy confidency on actuallity of your proxy list:
70
+
71
+ ``` ruby
72
+ proxy.get!
73
+ # => ["127.0.0.1", 8080]
74
+ ```
75
+
76
+ You can also get for than one proxy per request by adding count for both
77
+ methods like this:
66
78
67
79
``` ruby
68
80
proxy.get(2 )
69
81
# => [["127.0.0.1", 80], ["127.0.0.1", 8080]]
70
- ```
71
82
72
- Will be returning only pingable proxies
83
+ proxy.get!(2 )
84
+ # => [["127.0.0.1", 80], ["127.0.0.1", 8080]]
85
+ ```
73
86
74
- ### Proxies lists
87
+ ### Proxies list
75
88
76
- You also can display list of loaded proxies
89
+ For display list of loaded proxies use ` list ` method:
77
90
78
91
``` ruby
79
92
proxy.list
80
93
# => [["127.0.0.1", 80], ["127.0.0.1", 8080]]
81
94
```
82
95
96
+ ### Checking proxy manually
97
+
98
+ You can also use class method for checking availability manually like this:
99
+
100
+ ``` ruby
101
+ # by passing a string
102
+ ProxyManager ::Proxy .connectable?(' 127.0.0.1:80' )
103
+ # => false
104
+
105
+ # or by passing an array
106
+ ProxyManager ::Proxy .connectable?(' 127.0.0.1' , 80 )
107
+ # => false
108
+ ```
109
+
83
110
## Documentation
84
111
85
- http://rubydoc.info/gems/proxy_manager/frames
112
+ http://rubydoc.info/gems/proxy_manager
86
113
87
114
## Contributing
88
115
0 commit comments