stun-client 1.0 → 1.01

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ea649544689d1e375c9df68c7d89f27453ff2aee4c22ed21ebc305c9dfd2763
4
- data.tar.gz: ea80323fdf18d49c55a1c3ace5c6ba82b8729c6b116ff615f4e0faf8fe498ef3
3
+ metadata.gz: 6b0c1f5d3e654004691ea90db9b40787b257d4596c384f0e27d4baf5cb4f4ec7
4
+ data.tar.gz: cf3bed6c5e8dc3c19dbccb2442c59e1d21abc48688ec8e9dcfa66f6666101fa9
5
5
  SHA512:
6
- metadata.gz: f7df8d98b38a4bf969bd604959eb4e3424fb24214e1e4dc9483e19bf7aeee8c254ecb6c924914f42f9e98528e118898a3ab6c7c18ffc090709d876d1c741fdb6
7
- data.tar.gz: 268abe533cf78836373dfc7a95f7af84cda388fc1d0eb6ede0295bbe570d26e1c3957c36d4e981845ee460889637d904c14f9003e770a376d4d05816203668d6
6
+ metadata.gz: fc380679d229f44b199fc6fbc85d0a644105a188147f9d7c859d72e760f1bd5036ea56041cf4d65890b9a8c1f111b63ce8da4024cea9599266b9276ac7be0897
7
+ data.tar.gz: c11e7248836f549ce7d7ce0f3951062269c40ab7b7de1c45a021f02beef1bf39a28e83b8f25adcb35fdc6105940b31ca071c52e32a9dd3c2f2a25f543baf5c94
@@ -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.01
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.01'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Küthe