Skip to content

Commit 7a00b90

Browse files
author
Kirill Platonov
committed
update readme
1 parent 476bd63 commit 7a00b90

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

README.md

+35-8
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ or from file
4444
proxy = ProxyManager::Proxy.new('proxies.txt')
4545
```
4646

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.
4849
Example of `proxies.txt` content:
4950

5051
```
@@ -55,34 +56,60 @@ Example of `proxies.txt` content:
5556

5657
### Get proxy
5758

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:
5962

6063
```ruby
6164
proxy.get
6265
# => ["127.0.0.1", 80]
6366
```
6467

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:
6678

6779
```ruby
6880
proxy.get(2)
6981
# => [["127.0.0.1", 80], ["127.0.0.1", 8080]]
70-
```
7182

72-
Will be returning only pingable proxies
83+
proxy.get!(2)
84+
# => [["127.0.0.1", 80], ["127.0.0.1", 8080]]
85+
```
7386

74-
### Proxies lists
87+
### Proxies list
7588

76-
You also can display list of loaded proxies
89+
For display list of loaded proxies use `list` method:
7790

7891
```ruby
7992
proxy.list
8093
# => [["127.0.0.1", 80], ["127.0.0.1", 8080]]
8194
```
8295

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+
83110
## Documentation
84111

85-
http://rubydoc.info/gems/proxy_manager/frames
112+
http://rubydoc.info/gems/proxy_manager
86113

87114
## Contributing
88115

0 commit comments

Comments
 (0)