sockit 1.1.0 → 1.1.1

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
  SHA1:
3
- metadata.gz: e0f71f16baf9da3f1b8ee636541b5e933a61962b
4
- data.tar.gz: af6a677353e4b9e2a72a3a33759c6525570c9c9b
3
+ metadata.gz: 6c121958f45f2d643ce189f5b7931eda37cea135
4
+ data.tar.gz: 04bfee78cc8309658de13c3f6dd9f8b8a313e2bc
5
5
  SHA512:
6
- metadata.gz: 9ea3d5c8ce8f95454149893720887f4ae63c0201b7d82b283ff61177e939fc3e59384762f6ba1dc31876d45bb334e0cebc630e76ad761715b354c2bb5ee7960f
7
- data.tar.gz: 87e08997ef2cd8994bd9eb781f27a4b9fe6e74f4b2b39de02f33da664721c56aa49fb8ac86a5b3980220ed1f80adfa50f6e40d0c66154a92f8271bc391fe9bd2
6
+ metadata.gz: b90163e36c436a4424aef2e6236e3d1f54628897931c79e69d3f67bf0905bdb7c452407c2deddcc0153e8c329c379b965551fa610faaa4c4d1ff51c3f1e83f68
7
+ data.tar.gz: 9facd1457c32dcc3f7474f74e845a489b91d3822fe3db1bb4063b10c83760df351d0300e2f4a5bf580143bb712ca41e47b9aafb7167063cce8d8e05eb238b6fe
data/.travis.yml CHANGED
@@ -5,12 +5,12 @@ rvm:
5
5
  - 2.3.0
6
6
  branches:
7
7
  only:
8
- - master
8
+ - master
9
9
  before_install:
10
- - "./spec/support/before_install.sh"
10
+ - "./spec/support/before_install.sh"
11
11
  notifications:
12
12
  irc:
13
13
  channels:
14
- - "irc.freenode.net#jovelabs"
14
+ - "irc.freenode.net#jovelabs"
15
15
  use_notice: true
16
16
  skip_join: true
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  ################################################################################
2
2
  #
3
- # Author: Zachary Patten <zachary@jovelabs.net>
3
+ # Author: Zachary Patten <zpatten AT jovelabs DOT io>
4
4
  # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/sockit.png)](http://badge.fury.io/rb/sockit)
2
2
  [![Build Status](https://secure.travis-ci.org/zpatten/sockit.png)](http://travis-ci.org/zpatten/sockit)
3
- [![Coverage Status](https://coveralls.io/repos/zpatten/sockit/badge.png?branch=master)](https://coveralls.io/r/zpatten/sockit)
3
+ [![Coverage Status](https://coveralls.io/repos/github/zpatten/sockit/badge.png?branch=master)](https://coveralls.io/github/zpatten/sockit?branch=master)
4
4
  [![Dependency Status](https://gemnasium.com/zpatten/sockit.png)](https://gemnasium.com/zpatten/sockit)
5
5
  [![Code Climate](https://codeclimate.com/github/zpatten/sockit.png)](https://codeclimate.com/github/zpatten/sockit)
6
6
 
@@ -29,6 +29,10 @@ Or install it yourself as:
29
29
 
30
30
  $ gem install sockit
31
31
 
32
+ Then run the pry console to play with it:
33
+
34
+ $ bundle exec sockit
35
+
32
36
  ## USAGE
33
37
 
34
38
  By loading the gem TCPSocket will get monkey patched adding seamless transparent SOCKS proxy support. I favor using SS5 for a SOCKS server, so at this point I'm uncertain of absolute compatibility with other SOCKS servers. I'm following the RFC here; so if (insert other SOCKS server flavor here) follows the RFC everything is in theory compatible.
@@ -87,6 +91,12 @@ I use SS5 for my SOCKS servers. It works well and is easy to configure. It is
87
91
 
88
92
  I await your pull request.
89
93
 
94
+ # RUBIES TESTED AGAINST
95
+
96
+ * Ruby 2.0.0
97
+ * Ruby 2.2.4
98
+ * Ruby 2.3.0
99
+
90
100
  # RESOURCES
91
101
 
92
102
  IRC:
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  ################################################################################
2
2
  #
3
- # Author: Zachary Patten <zachary@jovelabs.net>
3
+ # Author: Zachary Patten <zpatten AT jovelabs DOT io>
4
4
  # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
data/bin/sockit CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  ################################################################################
3
3
  #
4
- # Author: Zachary Patten <zachary@jovelabs.net>
4
+ # Author: Zachary Patten <zpatten AT jovelabs DOT io>
5
5
  # Copyright: Copyright (c) Zachary Patten
6
6
  # License: Apache License, Version 2.0
7
7
  #
@@ -1,6 +1,6 @@
1
1
  ################################################################################
2
2
  #
3
- # Author: Zachary Patten <zachary@jovelabs.net>
3
+ # Author: Zachary Patten <zpatten AT jovelabs DOT io>
4
4
  # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
@@ -21,7 +21,7 @@
21
21
  module Sockit
22
22
 
23
23
  unless const_defined?(:VERSION)
24
- VERSION = "1.1.0"
24
+ VERSION = "1.1.1"
25
25
  end
26
26
 
27
27
  end
data/lib/sockit.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  ################################################################################
2
2
  #
3
- # Author: Zachary Patten <zachary@jovelabs.net>
3
+ # Author: Zachary Patten <zpatten AT jovelabs DOT io>
4
4
  # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
data/sockit.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  ################################################################################
2
2
  #
3
- # Author: Zachary Patten <zachary@jovelabs.net>
3
+ # Author: Zachary Patten <zpatten AT jovelabs DOT io>
4
4
  # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
@@ -17,9 +17,9 @@
17
17
  # limitations under the License.
18
18
  #
19
19
  ################################################################################
20
-
21
- # -*- encoding: utf-8 -*-
22
- require File.expand_path('../lib/sockit/version', __FILE__)
20
+ lib = File.expand_path('../lib', __FILE__)
21
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
22
+ require 'sockit/version'
23
23
 
24
24
  Gem::Specification.new do |spec|
25
25
  spec.name = "sockit"
@@ -89,123 +89,3 @@ describe Sockit do
89
89
  end
90
90
 
91
91
  end
92
-
93
- describe TCPSocket do
94
-
95
- describe "connections" do
96
-
97
- describe "direct" do
98
-
99
- it "should allow a direct connection to github" do
100
- Sockit.config do |config|
101
- config.version = nil
102
- config.host = nil
103
- config.port = nil
104
- end
105
-
106
- socket = TCPSocket.new('github.com', '22')
107
- data = socket.gets
108
- expect(data).to match(/SSH/)
109
- end
110
-
111
- end
112
-
113
- describe "SOCKS v5" do
114
-
115
- it "should allow a SOCKS v4 connection to github (no debug/no auth)" do
116
- Sockit.config do |config|
117
- config.debug = false
118
- config.version = 4
119
- config.host = "127.0.0.1"
120
- config.port = "1080"
121
- config.username = nil
122
- config.password = nil
123
- end
124
-
125
- socket = TCPSocket.new('github.com', '22')
126
- data = socket.gets
127
- expect(data).to match(/SSH/)
128
- end
129
-
130
- it "should allow a SOCKS v5 connection to github (no debug/no auth)" do
131
- Sockit.config do |config|
132
- config.debug = false
133
- config.version = 5
134
- config.host = "127.0.0.1"
135
- config.port = "1080"
136
- config.username = nil
137
- config.password = nil
138
- end
139
-
140
- socket = TCPSocket.new('github.com', '22')
141
- data = socket.gets
142
- expect(data).to match(/SSH/)
143
- end
144
-
145
- it "should allow a SOCKS v5 connection to github (debug/no auth)" do
146
- $stdout = File.open('/dev/null', 'w')
147
-
148
- Sockit.config do |config|
149
- config.debug = true
150
- config.version = 5
151
- config.host = "127.0.0.1"
152
- config.port = "1080"
153
- config.username = nil
154
- config.password = nil
155
- end
156
-
157
- socket = TCPSocket.new('github.com', '22')
158
- data = socket.gets
159
- expect(data).to match(/SSH/)
160
- end
161
-
162
- it "should allow a SOCKS v5 connection to github (no debug/auth)" do
163
- Sockit.config do |config|
164
- config.debug = false
165
- config.version = 5
166
- config.host = "127.0.0.1"
167
- config.port = "1081"
168
- config.username = "root"
169
- config.password = "none"
170
- end
171
-
172
- socket = TCPSocket.new('github.com', '22')
173
- data = socket.gets
174
- expect(data).to match(/SSH/)
175
- end
176
-
177
- it "should allow a SOCKS v5 connection to github (debug/auth)" do
178
- $stdout = File.open('/dev/null', 'w')
179
-
180
- Sockit.config do |config|
181
- config.debug = true
182
- config.version = 5
183
- config.host = "127.0.0.1"
184
- config.port = "1081"
185
- config.username = "root"
186
- config.password = "none"
187
- end
188
-
189
- socket = TCPSocket.new('github.com', '22')
190
- data = socket.gets
191
- expect(data).to match(/SSH/)
192
- end
193
-
194
- it "should throw an exception if we use bad credentials (no debug/auth)" do
195
- Sockit.config do |config|
196
- config.debug = false
197
- config.version = 5
198
- config.host = "127.0.0.1"
199
- config.port = "1081"
200
- config.username = "root"
201
- config.password = "blargh"
202
- end
203
-
204
- expect { TCPSocket.new('github.com', '22') }.to raise_exception(SockitError)
205
- end
206
-
207
- end
208
-
209
- end
210
-
211
- end
@@ -0,0 +1,145 @@
1
+ ################################################################################
2
+ #
3
+ # Author: Zachary Patten <zpatten AT jovelabs DOT io>
4
+ # Copyright: Copyright (c) Zachary Patten
5
+ # License: Apache License, Version 2.0
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ ################################################################################
20
+
21
+ require "spec_helper"
22
+
23
+ describe "TCPSocket" do
24
+
25
+ after(:all) do
26
+ Sockit.config do |config|
27
+ config.version = nil
28
+ config.host = nil
29
+ config.port = nil
30
+ end
31
+ end
32
+
33
+ describe "connections" do
34
+
35
+ describe "direct" do
36
+
37
+ it "should allow a direct connection to github" do
38
+ Sockit.config do |config|
39
+ config.version = nil
40
+ config.host = nil
41
+ config.port = nil
42
+ end
43
+
44
+ socket = TCPSocket.new('github.com', '22')
45
+ data = socket.gets
46
+ expect(data).to match(/SSH/)
47
+ end
48
+
49
+ end
50
+
51
+ describe "SOCKS v5" do
52
+
53
+ it "should allow a SOCKS v4 connection to github (no debug/no auth)" do
54
+ Sockit.config do |config|
55
+ config.debug = false
56
+ config.version = 4
57
+ config.host = "127.0.0.1"
58
+ config.port = "1080"
59
+ config.username = nil
60
+ config.password = nil
61
+ end
62
+
63
+ socket = TCPSocket.new('github.com', '22')
64
+ data = socket.gets
65
+ expect(data).to match(/SSH/)
66
+ end
67
+
68
+ it "should allow a SOCKS v5 connection to github (no debug/no auth)" do
69
+ Sockit.config do |config|
70
+ config.debug = false
71
+ config.version = 5
72
+ config.host = "127.0.0.1"
73
+ config.port = "1080"
74
+ config.username = nil
75
+ config.password = nil
76
+ end
77
+
78
+ socket = TCPSocket.new('github.com', '22')
79
+ data = socket.gets
80
+ expect(data).to match(/SSH/)
81
+ end
82
+
83
+ it "should allow a SOCKS v5 connection to github (debug/no auth)" do
84
+ Sockit.config do |config|
85
+ config.debug = true
86
+ config.version = 5
87
+ config.host = "127.0.0.1"
88
+ config.port = "1080"
89
+ config.username = nil
90
+ config.password = nil
91
+ end
92
+
93
+ socket = TCPSocket.new('github.com', '22')
94
+ data = socket.gets
95
+ expect(data).to match(/SSH/)
96
+ end
97
+
98
+ it "should allow a SOCKS v5 connection to github (no debug/auth)" do
99
+ Sockit.config do |config|
100
+ config.debug = false
101
+ config.version = 5
102
+ config.host = "127.0.0.1"
103
+ config.port = "1081"
104
+ config.username = "root"
105
+ config.password = "none"
106
+ end
107
+
108
+ socket = TCPSocket.new('github.com', '22')
109
+ data = socket.gets
110
+ expect(data).to match(/SSH/)
111
+ end
112
+
113
+ it "should allow a SOCKS v5 connection to github (debug/auth)" do
114
+ Sockit.config do |config|
115
+ config.debug = true
116
+ config.version = 5
117
+ config.host = "127.0.0.1"
118
+ config.port = "1081"
119
+ config.username = "root"
120
+ config.password = "none"
121
+ end
122
+
123
+ socket = TCPSocket.new('github.com', '22')
124
+ data = socket.gets
125
+ expect(data).to match(/SSH/)
126
+ end
127
+
128
+ it "should throw an exception if we use bad credentials (no debug/auth)" do
129
+ Sockit.config do |config|
130
+ config.debug = false
131
+ config.version = 5
132
+ config.host = "127.0.0.1"
133
+ config.port = "1081"
134
+ config.username = "root"
135
+ config.password = "blargh"
136
+ end
137
+
138
+ expect{ TCPSocket.new('github.com', '22') }.to raise_exception(SockitError)
139
+ end
140
+
141
+ end
142
+
143
+ end
144
+
145
+ end
data/spec/spec_helper.rb CHANGED
@@ -17,26 +17,24 @@
17
17
  # limitations under the License.
18
18
  #
19
19
  ################################################################################
20
+
21
+ require 'codeclimate-test-reporter'
22
+ require 'coveralls'
20
23
  require 'simplecov'
21
24
  require 'simplecov-rcov'
22
- ################################################################################
23
- ENV['CODECLIMATE_REPO_TOKEN'] = "5bfff36fe2faa17f9251e2e5cebc5b7fb277fa58f49e6d84451f8a1a0329da0d"
24
- require "codeclimate-test-reporter"
25
- CodeClimate::TestReporter.start
26
- ################################################################################
27
- require 'coveralls'
28
- Coveralls.wear!
29
- ################################################################################
25
+ require 'yarjuf'
26
+
30
27
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
31
28
  [
29
+ CodeClimate::TestReporter::Formatter,
30
+ Coveralls::SimpleCov::Formatter,
32
31
  SimpleCov::Formatter::HTMLFormatter,
33
- SimpleCov::Formatter::RcovFormatter,
34
- Coveralls::SimpleCov::Formatter
32
+ SimpleCov::Formatter::RcovFormatter
35
33
  ]
36
34
  )
35
+
37
36
  SimpleCov.start
38
- ################################################################################
39
- require 'yarjuf'
37
+
40
38
  ################################################################################
41
39
 
42
40
  require 'tempfile'
@@ -2,7 +2,7 @@
2
2
  set -ex
3
3
 
4
4
  sudo apt-get -qy update
5
- sudo apt-get -qy install wget build-essential libpam0g-dev libbsd-dev libbsd0 libbsd0-dbg libssl-dev libldap2-dev
5
+ sudo apt-get -qy install build-essential libpam0g-dev libbsd-dev libbsd0 libbsd0-dbg libssl-dev libldap2-dev
6
6
 
7
7
  tar -zxvf spec/support/ss5-3.8.9-8.tar.gz
8
8
  cd ss5*
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sockit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Patten
@@ -209,6 +209,7 @@ files:
209
209
  - lib/sockit/version.rb
210
210
  - sockit.gemspec
211
211
  - spec/sockit/sockit_spec.rb
212
+ - spec/sockit/tcpsocket_spec.rb
212
213
  - spec/spec_helper.rb
213
214
  - spec/support/before_install.sh
214
215
  - spec/support/ss5-3.8.9-8.tar.gz
@@ -238,6 +239,7 @@ specification_version: 4
238
239
  summary: Transparent SOCKS v4 and SOCKS v5 support for TCPSocket
239
240
  test_files:
240
241
  - spec/sockit/sockit_spec.rb
242
+ - spec/sockit/tcpsocket_spec.rb
241
243
  - spec/spec_helper.rb
242
244
  - spec/support/before_install.sh
243
245
  - spec/support/ss5-3.8.9-8.tar.gz