rb-portless 0.3.0.dev.20260630.fb5fc36 → 0.3.0

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: ad245d30c0c47ba8ac0be15c5483524cedc6d2a6fffd30b4df35ad0904287af6
4
- data.tar.gz: 64e421e608545dc03fa7ad75506cd473ae86cece15b90bc38395c03fa8db0bba
3
+ metadata.gz: e49a039bffaf418a826c61337253e8cf3f46c54b500f30936fba6e8153f96804
4
+ data.tar.gz: b4c6fad1e96ac1c2fd11a9366ad36273af95976e2abcdb1387d4b1b60dd1bd27
5
5
  SHA512:
6
- metadata.gz: cf6f98facf2bc05067f832f1f865b18977a00b9cbd608189289d5c89284a2b887f1d056cbcf3c664ef5a5a4762808e30dea9c1b8f582e430750562ce8b3c3b4b
7
- data.tar.gz: '02658fcdf8c2ad85e58a3d5cf71148dcbec8819adb2d0bc439ec06cb44aad599d5e84a0055804ce910374f72012720e758ed418a7ded1e25033f57760f433d13'
6
+ metadata.gz: 7754996324bcc3c53dac67a3c2999cc2c57d25d0bc6126ac4041d6dfb2936c49ca675b63ddb1fb24d86ad5b3a49b76b76e7397ae20f32f0d637f3b3f63e4f640
7
+ data.tar.gz: ec5a8e7ff23b18f7766015e11627938776d88eb672fe174a3902e273af14d044f69db69a146de48284799e08de5425544837a94160cf3c2ddf6eff7faa447673
data/CHANGELOG.md CHANGED
@@ -15,9 +15,12 @@ All notable changes to this project are documented here. The format follows
15
15
 
16
16
  - **Risky-TLD warning.** Warn when the configured `tld` ends in a real/reserved
17
17
  TLD (`dev`, `app`, `local`, …) that could intercept live traffic.
18
- - **More tests** — health probes and privilege logic. (Verified manually, since
19
- the Async proxy can't be driven in-process without deadlock: HTTP/HTTPS/HTTP-2
20
- forwarding, wildcard routing, and the **WebSocket upgrade relay** / ActionCable.)
18
+ - **More tests** — `Proxy#call` is now public, so the proxy's routing + error
19
+ logic is unit-tested (404 / 508 loop guard / 502 dead-backend, all stamped with
20
+ the health header) plus health probes and privilege logic (42 tests). The
21
+ successful byte-forward + **WebSocket upgrade relay** (ActionCable) need a live
22
+ reactor and are verified end-to-end manually — async-http servers can't be torn
23
+ down in-process without deadlock.
21
24
 
22
25
 
23
26
  - **Startup banner.** Running a dev server through rb-portless now prints a clear
@@ -51,13 +51,10 @@ module Portless
51
51
  routes.find { |r| host.end_with?(".#{r.hostname}") }
52
52
  end
53
53
 
54
- private
55
-
56
- def make_server(endpoint)
57
- Async::HTTP::Server.for(endpoint) { |request| handle(request) }
58
- end
59
-
60
- def handle(request)
54
+ # The reverse-proxy app: resolve the request's host to a backend, forward it,
55
+ # stamp the health header. Public so it can be mounted in a test reactor
56
+ # (Async::HTTP::Server.for(endpoint, &proxy.method(:call))).
57
+ def call(request)
61
58
  host = request_host(request)
62
59
  route = route_for(host)
63
60
  return error(404, "No app is registered for #{host}.") unless route
@@ -72,6 +69,12 @@ module Portless
72
69
  error(502, "Backend for #{host} is not responding (#{e.class}).")
73
70
  end
74
71
 
72
+ private
73
+
74
+ def make_server(endpoint)
75
+ Async::HTTP::Server.for(endpoint) { |request| call(request) }
76
+ end
77
+
75
78
  def build_forward(request, host, hops)
76
79
  headers = Protocol::HTTP::Headers.new
77
80
  request.headers.each do |key, value|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Portless
4
- VERSION = "0.3.0.dev.20260630.fb5fc36"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rb-portless
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.dev.20260630.fb5fc36
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Afonso