proxied_request 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -0
- data/lib/proxied_request/config.rb +9 -0
- data/lib/proxied_request/request.rb +2 -0
- data/lib/proxied_request/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df986a2d5e8acd42ed1282e77d1a26e21464f22894155ca80f81dac6b2ccd733
|
4
|
+
data.tar.gz: fec7e0118b993230dabdb5abd80950a5a5f09093308b2bac4e0988dba46f5760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fcea41f7ba5dd0cf2ba9f459119c8a4f70f7231155ec6cd094e5158f824239b20c982dc9b96b422b360ff0f1f75869b000c238eea1c87cfd321ffad9413da51
|
7
|
+
data.tar.gz: e81669b8302f86dce957d6e28a016586f4ed0067f6c124a7bbb43fb8b3e071bae05d7264b6f690d6e1cd0ae4a8e282b0fd13a356a90b57cd748a8224722d23eb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,10 +10,18 @@ Locate your torrc (**Tor Browser\Browser\TorBrowser\Data\Tor**) file and add the
|
|
10
10
|
SocksPort 127.0.0.1:9050
|
11
11
|
```
|
12
12
|
|
13
|
+
Install the gem:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
gem install proxied_request
|
17
|
+
```
|
18
|
+
|
13
19
|
## Usage
|
14
20
|
|
15
21
|
1. Start tor
|
16
22
|
|
23
|
+
2. Make a request:
|
24
|
+
|
17
25
|
```ruby
|
18
26
|
require 'proxied_request'
|
19
27
|
|
@@ -25,5 +33,6 @@ puts response.body # =>
|
|
25
33
|
config = ProxiedRequest::Config.new
|
26
34
|
config.set_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0')
|
27
35
|
config.type = MethodType::POST
|
36
|
+
config.body = 'foo=bar'
|
28
37
|
response = ProxiedRequest::HTTP.request('https://api.ipify.org', config)
|
29
38
|
puts response.body # =>
|
@@ -11,10 +11,15 @@ module ProxiedRequest
|
|
11
11
|
@type = MethodType::GET
|
12
12
|
|
13
13
|
@headers = {}
|
14
|
+
@body = nil
|
14
15
|
|
15
16
|
@timeout = 10
|
16
17
|
end
|
17
18
|
|
19
|
+
def body=(body)
|
20
|
+
@body = body
|
21
|
+
end
|
22
|
+
|
18
23
|
def type=(type)
|
19
24
|
@type = type
|
20
25
|
end
|
@@ -54,5 +59,9 @@ module ProxiedRequest
|
|
54
59
|
def get_type
|
55
60
|
@type
|
56
61
|
end
|
62
|
+
|
63
|
+
def get_body
|
64
|
+
@body
|
65
|
+
end
|
57
66
|
end
|
58
67
|
end
|