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 +4 -4
- data/lib/stun-client/module.rb +1 -1
- data/lib/stun-client/rfc3489/discovery/nat.rb +3 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b0c1f5d3e654004691ea90db9b40787b257d4596c384f0e27d4baf5cb4f4ec7
|
4
|
+
data.tar.gz: cf3bed6c5e8dc3c19dbccb2442c59e1d21abc48688ec8e9dcfa66f6666101fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc380679d229f44b199fc6fbc85d0a644105a188147f9d7c859d72e760f1bd5036ea56041cf4d65890b9a8c1f111b63ce8da4024cea9599266b9276ac7be0897
|
7
|
+
data.tar.gz: c11e7248836f549ce7d7ce0f3951062269c40ab7b7de1c45a021f02beef1bf39a28e83b8f25adcb35fdc6105940b31ca071c52e32a9dd3c2f2a25f543baf5c94
|
data/lib/stun-client/module.rb
CHANGED
@@ -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 && (!
|
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
|
-
|
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
|