proxied_request 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5590485b177d091030b6ef71d5966c6dc5933e6267a0ce5e067ee03021b2c316
4
- data.tar.gz: 4f1eb2de2674174e61b106e7031f8c797e4e9d0063f771727e8c7f8874d6c830
3
+ metadata.gz: df986a2d5e8acd42ed1282e77d1a26e21464f22894155ca80f81dac6b2ccd733
4
+ data.tar.gz: fec7e0118b993230dabdb5abd80950a5a5f09093308b2bac4e0988dba46f5760
5
5
  SHA512:
6
- metadata.gz: b143ad0e824660f7485514680fc20728374dc3a56dfd789e5db2492f9ec204ac8d2bce2a7a19d44b02ebd38c0ccc0c81272a142d6bfdcf19acd682d6c53678f0
7
- data.tar.gz: 2036d716fd5caa09a47031d746945398df8223d2afa2469d8975f6e07ec76319114e2e97887a22f68b8f9f5f855e4e081b1d0182a3286b6e6d30bc50e2cabe29
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.0"
4
+ VERSION = "0.1.2"
5
5
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["plusleft"]
9
9
  spec.email = ["107749872+0xleft@users.noreply.github.com"]
10
10
 
11
- spec.summary = "Make HTTP requests through a proxy."
11
+ spec.summary = "Make HTTP requests through a tor as proxy."
12
12
  spec.homepage = "https://github.com/0xleft/proxiedrequest"
13
13
  spec.license = "MIT"
14
14
  spec.required_ruby_version = ">= 2.6.0"
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.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - plusleft
@@ -54,5 +54,5 @@ requirements: []
54
54
  rubygems_version: 3.4.10
55
55
  signing_key:
56
56
  specification_version: 4
57
- summary: Make HTTP requests through a proxy.
57
+ summary: Make HTTP requests through a tor as proxy.
58
58
  test_files: []