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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35d6aae1afb0f6f68c1f3ff19f33afc1655cb220e3965d98989fc100359e5ccf
4
- data.tar.gz: f929eeb436f3eb033a4835d368e5d57b37b93091ed265b792bc1a9e90fb8797a
3
+ metadata.gz: df986a2d5e8acd42ed1282e77d1a26e21464f22894155ca80f81dac6b2ccd733
4
+ data.tar.gz: fec7e0118b993230dabdb5abd80950a5a5f09093308b2bac4e0988dba46f5760
5
5
  SHA512:
6
- metadata.gz: aa1f2afdb0c470d02de176a4ee5e2a6393abb0e3664f0194cb4c5d24c0650e151a2f4306ddc2704abe8065037169a5d708a7bbb052bd5f8b86d0a3fe678393d1
7
- data.tar.gz: da011be4a27cc2ec438b162772b8b24fec8b17182ffcba2e858192a5b93128f47146cd82bf3a6b36e5f24aa71464c878465bc45362e23b556e2dcf12f0596b3b
6
+ metadata.gz: 1fcea41f7ba5dd0cf2ba9f459119c8a4f70f7231155ec6cd094e5158f824239b20c982dc9b96b422b360ff0f1f75869b000c238eea1c87cfd321ffad9413da51
7
+ data.tar.gz: e81669b8302f86dce957d6e28a016586f4ed0067f6c124a7bbb43fb8b3e071bae05d7264b6f690d6e1cd0ae4a8e282b0fd13a356a90b57cd748a8224722d23eb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proxied_request (0.1.0)
4
+ proxied_request (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -51,6 +51,8 @@ module ProxiedRequest
51
51
  request.add_field(key, value)
52
52
  end
53
53
 
54
+ request.body = config.get_body
55
+
54
56
  http.open_timeout = config.get_timeout
55
57
 
56
58
  response = http.request(request)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProxiedRequest
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxied_request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - plusleft