sockit 1.1.1 → 1.2.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 +4 -4
- data/lib/sockit/connection.rb +2 -2
- data/lib/sockit/support.rb +1 -1
- data/lib/sockit/version.rb +1 -1
- data/lib/sockit.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4cb03123797163d6a7b4a0277a607497eb0cd9c
|
4
|
+
data.tar.gz: 4af7863f1723de14a2d0acd54eea61bf1b5038bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e6d1428f0ac8cab895403bc04f93ee6ec4db8b4906eb146e44b943c55c01d558c041f9a634f000bc3bf13f3d044751a93e56c11461e81356ac3698ecc3e1a40
|
7
|
+
data.tar.gz: d380d476862b6fc0d1edf78af829a2785ee37f54e3e6c7112ad265b8c42b7dbab59063f27641e40e7146757eef2fdc427d1569d5721f5f3f9f875b999efb04be
|
data/lib/sockit/connection.rb
CHANGED
@@ -2,9 +2,9 @@ module Sockit
|
|
2
2
|
module Connection
|
3
3
|
|
4
4
|
def direct_connect(socket, remote_host, remote_port, local_host=nil, local_port=nil)
|
5
|
-
log(:yellow, "Directly connecting to #{remote_host}:#{remote_port}")
|
5
|
+
Sockit.enabled? and log(:yellow, "Directly connecting to #{remote_host}:#{remote_port}")
|
6
6
|
socket.__send__(:initialize_tcp, remote_host, remote_port, local_host=nil, local_port=nil)
|
7
|
-
log(:green, "Connected to #{remote_host}:#{remote_port}")
|
7
|
+
Sockit.enabled? and log(:green, "Connected to #{remote_host}:#{remote_port}")
|
8
8
|
end
|
9
9
|
|
10
10
|
def connect(socket, host, port)
|
data/lib/sockit/support.rb
CHANGED
data/lib/sockit/version.rb
CHANGED
data/lib/sockit.rb
CHANGED
@@ -69,6 +69,18 @@ module Sockit
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
def enabled
|
73
|
+
@@enabled ||= false
|
74
|
+
end
|
75
|
+
|
76
|
+
def enable
|
77
|
+
@@enabled = true
|
78
|
+
end
|
79
|
+
|
80
|
+
def disable
|
81
|
+
@@enabled = false
|
82
|
+
end
|
83
|
+
|
72
84
|
extend Sockit::V5::Authentication
|
73
85
|
extend Sockit::V5::Connection
|
74
86
|
extend Sockit::V5::Support
|
@@ -83,8 +95,9 @@ end
|
|
83
95
|
class TCPSocket
|
84
96
|
|
85
97
|
alias :initialize_tcp :initialize
|
98
|
+
|
86
99
|
def initialize(remote_host, remote_port, local_host=nil, local_port=nil)
|
87
|
-
if Sockit.connect_via_socks?(remote_host)
|
100
|
+
if Sockit.enabled? && Sockit.connect_via_socks?(remote_host)
|
88
101
|
initialize_tcp(Sockit.config.host, Sockit.config.port)
|
89
102
|
Sockit.perform_v5_authenticate(self) if Sockit.is_socks_v5?
|
90
103
|
Sockit.connect(self, remote_host, remote_port)
|
@@ -92,4 +105,5 @@ class TCPSocket
|
|
92
105
|
Sockit.direct_connect(self, remote_host, remote_port, local_host, local_port)
|
93
106
|
end
|
94
107
|
end
|
108
|
+
|
95
109
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sockit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Patten
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codeclimate-test-reporter
|