proxifier-fork 1.0.4 → 1.1.0

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
- SHA1:
3
- metadata.gz: 62f6989420dada48d1a8ab2907bc9190f5219bb3
4
- data.tar.gz: 0aa7b212e7f3c58c37a60a399732113359469c01
2
+ SHA256:
3
+ metadata.gz: 3406c5425bc8ac8f85638bc6f1d4a7a34c856c97bb736068626f28b87a5a6d6a
4
+ data.tar.gz: 5adb728639edebd3b92e55764bd473b62347932cd120854ca67250cd79d6cf88
5
5
  SHA512:
6
- metadata.gz: 02b51fda9b4e7e9074a5c861b51353d18a24aed5ac3c33a130626b0db08a0c806e2c07887bc1dc41f9f68f608fc8a9d5a43af84b15fdf433854c10577227b386
7
- data.tar.gz: 41541fd236088f779f93b8742299b8dc9e918fee26844dc8a97541211ed5fbbe4af03e7793d6208ffd2a5d3a6e223b0e5d7494ebbb83de6a31a23177a44c19d0
6
+ metadata.gz: d876a8b2217c3ccae0baf110d5fb5648ecfeec58df773f98c112118362a5a6527e2eff7f6368c7345344fe4284b19c5775f3c8895e52ff8f8496e015cfff5298
7
+ data.tar.gz: b87e9fe9a646864abaef9cedbb5f7f157d933fb357b6242653cf58315242333b3de47e27edfa7d7da6a4784df12e82c56a8bca47a40996ceca1c54c8e24714d5
data/README.md CHANGED
@@ -1,17 +1,28 @@
1
1
  # ruby-proxifier
2
2
 
3
+ ## Fork status
4
+
5
+ This is a fork of https://github.com/samuelkadolph/ruby-proxifier
6
+
7
+ Changes in the fork:
8
+
9
+ - **v1.1.0:** Fix schemes to work with Ruby >= 3.1. Remove use of autoload.
10
+
11
+ - **v1.0.4:** Allow customizing HTTP User-Agent header sent when connecting to
12
+ proxy.
13
+
3
14
  ## Installing
4
15
 
5
16
  ### Recommended
6
17
 
7
18
  ```
8
- gem install proxifier
19
+ gem install proxifier-fork
9
20
  ```
10
21
 
11
22
  ### Edge
12
23
 
13
24
  ```
14
- git clone https://github.com/samuelkadolph/ruby-proxifier
25
+ git clone https://github.com/ab/ruby-proxifier
15
26
  cd ruby-proxifier && rake install
16
27
  ```
17
28
 
@@ -76,7 +87,7 @@ precedence):
76
87
  ### Ruby
77
88
 
78
89
  ```ruby
79
- require "proxifier/proxy"
90
+ require "proxifier"
80
91
 
81
92
  proxy = Proxifier::Proxy("socks://localhost")
82
93
  socket = proxy.open("www.google.com", 80)
@@ -1,5 +1,5 @@
1
1
  require "net/http"
2
- require "proxifier/proxy"
2
+ require_relative "../proxy"
3
3
 
4
4
  module Proxifier
5
5
  class HTTPProxy < Proxy
@@ -1,5 +1,5 @@
1
1
  require "ipaddr"
2
- require "proxifier/proxy"
2
+ require_relative "../proxy"
3
3
 
4
4
  module Proxifier
5
5
  class SOCKSProxy < Proxy
@@ -1,4 +1,4 @@
1
- require "proxifier/proxies/socks"
1
+ require_relative "./socks"
2
2
 
3
3
  module Proxifier
4
4
  class SOCKS4Proxy < SOCKSProxy
@@ -1,4 +1,5 @@
1
- require "proxifier/proxies/socks"
1
+ require_relative "../proxies/socks"
2
+ require_relative "../proxy"
2
3
 
3
4
  module Proxifier
4
5
  class SOCKS4AProxy < SOCKSProxy
@@ -1,6 +1,7 @@
1
1
  require "socket"
2
2
  require "uri"
3
- require "uri/socks"
3
+
4
+ require_relative "../uri/socks"
4
5
 
5
6
  module Proxifier
6
7
  class Proxy
@@ -1,3 +1,3 @@
1
1
  module Proxifier
2
- VERSION = "1.0.4"
2
+ VERSION = "1.1.0"
3
3
  end
data/lib/proxifier.rb CHANGED
@@ -1,15 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "uri"
2
- require "uri/socks"
4
+ require_relative "uri/socks"
3
5
 
4
- module Proxifier
5
- require "proxifier/version"
6
+ require_relative "proxifier/version"
6
7
 
7
- autoload :HTTPProxy, "proxifier/proxies/http"
8
- autoload :SOCKSProxy, "proxifier/proxies/socks"
9
- autoload :SOCKS5Proxy, "proxifier/proxies/socks"
10
- autoload :SOCKS4Proxy, "proxifier/proxies/socks4"
11
- autoload :SOCKS4AProxy, "proxifier/proxies/socks4a"
8
+ require_relative "proxifier/proxy"
9
+ require_relative "proxifier/proxies/http"
10
+ require_relative "proxifier/proxies/socks"
11
+ require_relative "proxifier/proxies/socks"
12
+ require_relative "proxifier/proxies/socks4"
13
+ require_relative "proxifier/proxies/socks4a"
12
14
 
15
+ module Proxifier
13
16
  def self.Proxy(url, options = {})
14
17
  url = URI.parse(url)
15
18
 
data/lib/uri/socks.rb CHANGED
@@ -1,18 +1,32 @@
1
- require "uri/generic"
1
+ require 'uri/generic'
2
2
 
3
3
  module URI
4
- class SOCKS < Generic
4
+ class Socks < Generic
5
5
  DEFAULT_PORT = 1080
6
6
  COMPONENT = [:scheme, :userinfo, :host, :port, :query].freeze
7
+
8
+ def self.build(args)
9
+ tmp = Util.make_components_hash(self, args)
10
+ super(tmp)
11
+ end
12
+ end
13
+
14
+ class Socks4 < Socks
7
15
  end
8
- @@schemes["SOCKS"] = SOCKS
9
- @@schemes["SOCKS5"] = SOCKS
10
16
 
11
- class SOCKS4 < SOCKS
17
+ class Socks4A < Socks
12
18
  end
13
- @@schemes["SOCKS4"] = SOCKS4
14
19
 
15
- class SOCKS4A < SOCKS
20
+ mapping = {
21
+ 'SOCKS' => Socks,
22
+ 'SOCKS5' => Socks,
23
+ 'SOCKS4' => Socks4,
24
+ 'SOCKS4A' => Socks4A
25
+ }
26
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
27
+ mapping.each { |scheme, class_name| register_scheme scheme, class_name }
28
+ else
29
+ mapping.each { |scheme, class_name| @@schemes[scheme] = class_name }
16
30
  end
17
- @@schemes["SOCKS4A"] = SOCKS4A
18
31
  end
32
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxifier-fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Kadolph
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-17 00:00:00.000000000 Z
12
+ date: 2024-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -25,8 +25,12 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
- description: Proxifier adds support for HTTP or SOCKS proxies and lets you force TCPSocket
29
- to use proxies.
28
+ description: |2
29
+ Proxifier adds support for HTTP or SOCKS proxies and lets you force TCPSocket to use proxies.
30
+
31
+ This is a fork of proxifier https://github.com/samuelkadolph/ruby-proxifier
32
+
33
+ The fork allows the gem to run on modern ruby versions and adds some minor features.
30
34
  email:
31
35
  - samuel@kadolph.com
32
36
  - git@abrody.com
@@ -50,7 +54,8 @@ files:
50
54
  - lib/proxifier/version.rb
51
55
  - lib/uri/socks.rb
52
56
  homepage: https://github.com/ab/ruby-proxifier
53
- licenses: []
57
+ licenses:
58
+ - MIT
54
59
  metadata: {}
55
60
  post_install_message:
56
61
  rdoc_options: []
@@ -67,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
72
  - !ruby/object:Gem::Version
68
73
  version: '0'
69
74
  requirements: []
70
- rubyforge_project:
71
- rubygems_version: 2.4.5.1
75
+ rubygems_version: 3.4.19
72
76
  signing_key:
73
77
  specification_version: 4
74
78
  summary: Proxifier is a gem to force ruby to use a proxy.