weblink 1.1.0 → 1.1.1

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: d385e7232ce9202ce7b88e2ff864541243694f1b0a81fd40a8bb02b3ec0cc616
4
- data.tar.gz: ae5d4588789bad44e61d29094cf9aa73c1e230bee61b32df9fa70e2a074fc3dd
3
+ metadata.gz: b02d7b9671293e3f746c7fd1a85e3d53c8fcafa6dff31de008d7b40ec9792c25
4
+ data.tar.gz: 0f0e8b3e3ee29010a4a391aa8575e3429034269fc3620a926a62f64465522add
5
5
  SHA512:
6
- metadata.gz: 6a29a327435407af014c9bb887f4289536f5a28d6b1495dfd00e2892ee1396339efff8ae4b71b074ad256bab80808e22f41f1f9fa7857937a8fd61e08eabb3ad
7
- data.tar.gz: 8d358c66cc2a55d79988f34b7e9997209e978e4d0828fa5ff3aa39a86f5c85be39fc9ff000c81ee900b009d0fda1118b46170b4c19ad03cdb3a404f90dc3738f
6
+ metadata.gz: adb784f27aa8ea87b83db1c19007b20e89214a4e4760309d9b1e44e30db91b6bc802676e2aa7be5c8ac3c02ab833e57e834d2e481e63446dcfe5f5240ba8674b
7
+ data.tar.gz: 478418bdcb0db36ed9c14153a2ec38d01438c028ec430e4f81772fe4172bc0f422f631f1c1868d01e4a9eef18220097b78e841401656f3db9fb82bef9e7d880d
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 1.1.1
2
+
3
+ * Ignore interfaces with nil addresses
4
+
1
5
  1.1.0
2
6
 
3
7
  * Works on Windows
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
data/lib/relay.rb CHANGED
@@ -32,6 +32,7 @@ class Relay < EventMachine::Connection
32
32
 
33
33
  def unbind
34
34
  log('close')
35
+ # Status code 1000 indicates indicates a normal closure.
35
36
  @websocket&.close(1000) if @websocket&.state == :connected
36
37
  end
37
38
 
data/lib/weblink.rb CHANGED
@@ -16,11 +16,17 @@ class Weblink
16
16
  trap(:EXIT) { Process.waitall }
17
17
 
18
18
  if @opts[:client]
19
- public = File.expand_path('../public', __dir__)
20
- spawn('ruby', '-run', '-ehttpd', '--', public, err: IO::NULL)
21
-
22
- ip = Socket.getifaddrs.find { |ifa| ifa.addr.ipv4_private? }
23
- puts "Open http://#{ip.addr.ip_address}:8080/ on your other device." if ip
19
+ ip = Socket.getifaddrs.find { |ifa| ifa.addr&.ipv4_private? }
20
+ if ip
21
+ public = File.expand_path('../public', __dir__)
22
+ spawn('ruby', '-run', '-ehttpd', '--', public, err: IO::NULL)
23
+ puts "Open http://#{ip.addr.ip_address}:8080/ on your other device."
24
+ else
25
+ abort(
26
+ "Could not find an interface to listen on. " \
27
+ "Make sure that you are connected to your device."
28
+ )
29
+ end
24
30
  end
25
31
 
26
32
  if @opts[:server]
@@ -68,14 +74,14 @@ class Weblink
68
74
  return
69
75
  end
70
76
  xff = handshake.headers_downcased['x-forwarded-for']
71
- with_retry(3) do
77
+ with_retry(timeout: 3) do
72
78
  EventMachine.connect(socket, Relay, 'server', xff) do |rel|
73
79
  rel.start(ws)
74
80
  end
75
81
  end
76
82
  end
77
83
 
78
- def with_retry(timeout, wait: 0.1)
84
+ def with_retry(timeout:, wait: 0.1)
79
85
  elapsed = 0
80
86
  begin
81
87
  yield
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weblink
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
  - soylent
@@ -10,25 +10,30 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDGjCCAgKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA9lZmly
14
- L0RDPXNveWxlbnQwHhcNMjAwMzA3MDEzNzUwWh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aHViLmNvbTAN
29
+ BgkqhkiG9w0BAQsFAAOCAQEAsfJgulszbe+BgUP9xNYixuvm/R8Um5T8OAANmc+s
30
+ CvV3lD5XtFuw838TbWrqgN+7dVkzQYERTz8DjPtx+zlgzNS3GyMWNUZdOPLo/YkR
31
+ S7KfmAZlZhy1rcrARYsAouvP+1QttbiJ32L+z1JzAz2s1+4ySgl1OaQfosS04QGT
32
+ CnJ982/OGeG5xm7KFOqSzG4KnyEy4VH47aE4IQk+yP6R96neHdfOd/C7BcA6gbgH
33
+ lyshHS0Bgr1OKk3Vx8GtaIa7L9Z4RN0EWBL3QGlhiu55PrpPuAFDDuORJfpIqrph
34
+ XjC/3xZEDxBLYSjeFIgUMN6+/XGduQANkZ6167QsVu/yPg==
30
35
  -----END CERTIFICATE-----
31
- date: 2020-12-26 00:00:00.000000000 Z
36
+ date: 2022-01-27 00:00:00.000000000 Z
32
37
  dependencies:
33
38
  - !ruby/object:Gem::Dependency
34
39
  name: em-websocket
@@ -83,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
88
  - !ruby/object:Gem::Version
84
89
  version: '0'
85
90
  requirements: []
86
- rubygems_version: 3.1.4
91
+ rubygems_version: 3.3.4
87
92
  signing_key:
88
93
  specification_version: 4
89
94
  summary: Web browser gateway
metadata.gz.sig CHANGED
Binary file