stun-client 1.0 → 1.0.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
  SHA256:
3
- metadata.gz: 9ea649544689d1e375c9df68c7d89f27453ff2aee4c22ed21ebc305c9dfd2763
4
- data.tar.gz: ea80323fdf18d49c55a1c3ace5c6ba82b8729c6b116ff615f4e0faf8fe498ef3
3
+ metadata.gz: b3a3dc75283f39519208d5be9521167433cb2a74542193cd47f70e8ce0e012dc
4
+ data.tar.gz: d30d85146266df9e4a6c05deb5aff18754fdfa06ff7197bf763cf77638877303
5
5
  SHA512:
6
- metadata.gz: f7df8d98b38a4bf969bd604959eb4e3424fb24214e1e4dc9483e19bf7aeee8c254ecb6c924914f42f9e98528e118898a3ab6c7c18ffc090709d876d1c741fdb6
7
- data.tar.gz: 268abe533cf78836373dfc7a95f7af84cda388fc1d0eb6ede0295bbe570d26e1c3957c36d4e981845ee460889637d904c14f9003e770a376d4d05816203668d6
6
+ metadata.gz: 1a357fb2721d222c4661175d5bf9c2da82b18172d249393ae99ee4223cd9f8850981b4574ef605144ba382e0c958babe8d0fcc026c9a7fb89c1bc60dbeaf292c
7
+ data.tar.gz: 77c64711ef67b299f3c1b4dc4c54914d38d23b066dddc7aa2ec840345d31bdabc0e6f45b7fd93a53958d939e446c48dee0cfcf3002c17317f7c1740631776eb3
@@ -4,5 +4,5 @@
4
4
  # The StunClient library
5
5
  module StunClient
6
6
  # Contains the latest version of STUN Client.
7
- VERSION = 1.0
7
+ VERSION = "1.0.1"
8
8
  end
@@ -28,7 +28,7 @@ module StunClient
28
28
  # are `:IPv4` or `:IPv6`.
29
29
  def initialize host = nil, port = nil, protocol = :IPv4
30
30
  raise ArgumentError, 'Host must be a string' if host && (! host.is_a? String)
31
- raise ArgumentError, 'Port must be a integer' if port && (! host.is_a? Integer)
31
+ raise ArgumentError, 'Port must be a integer' if port && (! port.is_a? Integer)
32
32
 
33
33
  case protocol
34
34
  when :IPv6
@@ -114,16 +114,11 @@ module StunClient
114
114
  if test2
115
115
  flags << :full_cone_nat
116
116
  else
117
- # Run test 3 before test 1 variation 2, otherwise false NATs might be detected.
118
- # This occurs when the changed port is the same as the port the server responds
119
- # with in the change port request. Since you have already punched a hole in the
120
- # NAT with the previous request, the response from the STUN server gets through.
121
- test3 = do_query @host, @port, change_port: true
122
-
123
- test1v2 = do_query test1v1[:changed_address], test1v1[:changed_port].to_i
117
+ test1v2 = do_query test1v1[:changed_host], test1v1[:changed_port].to_i
124
118
  if test1v2
125
119
  if test1v1[:host] == test1v2[:host] &&
126
120
  test1v1[:port] == test1v2[:port]
121
+ test3 = do_query @host, @port, change_port: true
127
122
  if test3
128
123
  flags << :restricted_nat
129
124
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stun-client
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Küthe