falcon 0.18.6 → 0.18.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/falcon.gemspec +3 -1
- data/lib/falcon/command/serve.rb +0 -2
- data/lib/falcon/endpoint.rb +1 -0
- data/lib/falcon/proxy.rb +2 -1
- data/lib/falcon/version.rb +1 -1
- data/logo.afdesign +0 -0
- data/logo.svg +12 -7
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6478a325399d505af8b0adc9a6a18cbfc36ab92dd3099f0a36569a6f63794e82
|
4
|
+
data.tar.gz: b656a4bb1cbdf50aee0f1b3dbbfe4eb8a217a031a3244c954fbbe2a36c45e0fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7f8482964b862eb0cc24d88c26599131d09657c8f58b1a1d3ee559e99a64646fc1050eec19f5b635fc3305caf90d8e893aec3cb30cee3a883fe8279cba89b4
|
7
|
+
data.tar.gz: 021700b3d1e4cd4240de7e23a6b9ff375120e67f270c49562a76c9602c03eefe78d09c49dec098a1630aa2369f430469e8ca2734f6961b10f93d0e74bdff8128
|
data/README.md
CHANGED
@@ -51,6 +51,23 @@ Falcon works perfectly with `rails` apps.
|
|
51
51
|
|
52
52
|
Alternatively run `RACK_HANDLER=falcon rails server` to start the server (at least, until [rack#181](https://github.com/rack/rack/pull/1181) is merged).
|
53
53
|
|
54
|
+
#### Thread Safety (Rails < 5.x)
|
55
|
+
|
56
|
+
With older versons of Rails, the `Rack::Lock` middleware is inserted into your app unless you explicitly add `config.threadsafe!`. `Rack::Lock` will cause both poor performance and deadlocks due to the highly concurrent nature of `falcon`. Therefore, please ensure you specify `config.threadsafe!` in your `config/application.rb`:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
module MySite
|
60
|
+
class Application < Rails::Application
|
61
|
+
# ...
|
62
|
+
|
63
|
+
# Enable threaded mode
|
64
|
+
config.threadsafe!
|
65
|
+
end
|
66
|
+
end
|
67
|
+
```
|
68
|
+
|
69
|
+
This became the default in Rails 5 so no change is necessary in this version.
|
70
|
+
|
54
71
|
### WebSockets
|
55
72
|
|
56
73
|
Falcon supports `rack.hijack` for HTTP/1.x connections. You can thus use [async-websocket] in any controller layer to serve WebSocket connections.
|
@@ -79,7 +96,7 @@ You can invoke Falcon via `rackup`:
|
|
79
96
|
|
80
97
|
rackup --server falcon
|
81
98
|
|
82
|
-
This will run a single-threaded instance of Falcon.
|
99
|
+
This will run a single-threaded instance of Falcon using `http/1`. While it works fine, it's not recommended to use `rackup` with `falcon`, because performance will be limited.
|
83
100
|
|
84
101
|
## Performance
|
85
102
|
|
data/falcon.gemspec
CHANGED
@@ -16,8 +16,10 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
+
spec.add_dependency("http-protocol", "~> 0.5.0")
|
20
|
+
|
19
21
|
spec.add_dependency("async-io", "~> 1.9")
|
20
|
-
spec.add_dependency("async-http", "~> 0.
|
22
|
+
spec.add_dependency("async-http", "~> 0.31.0")
|
21
23
|
spec.add_dependency("async-container", "~> 0.6.0")
|
22
24
|
|
23
25
|
spec.add_dependency("rack", ">= 1.0")
|
data/lib/falcon/command/serve.rb
CHANGED
data/lib/falcon/endpoint.rb
CHANGED
data/lib/falcon/proxy.rb
CHANGED
@@ -19,6 +19,7 @@
|
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
21
|
require 'async/http/client'
|
22
|
+
require 'http/protocol/headers'
|
22
23
|
|
23
24
|
module Falcon
|
24
25
|
module BadRequest
|
@@ -33,7 +34,7 @@ module Falcon
|
|
33
34
|
class Proxy < Async::HTTP::Middleware
|
34
35
|
X_FORWARDED_FOR = 'x-forwarded-for'.freeze
|
35
36
|
VIA = 'via'.freeze
|
36
|
-
CONNECTION =
|
37
|
+
CONNECTION = ::HTTP::Protocol::CONNECTION
|
37
38
|
|
38
39
|
HOP_HEADERS = [
|
39
40
|
'connection',
|
data/lib/falcon/version.rb
CHANGED
data/logo.afdesign
ADDED
Binary file
|
data/logo.svg
CHANGED
@@ -35,26 +35,31 @@
|
|
35
35
|
</g>
|
36
36
|
<g transform="matrix(0.882487,0,0,0.533211,-371.748,95.1582)">
|
37
37
|
<g transform="matrix(1.13316,0,0,1.87543,-27.5826,-16.1583)">
|
38
|
-
<path d="
|
38
|
+
<path d="M228.068,94.768L228.068,63.178L252.768,63.178L252.768,60.058L228.068,60.058L228.068,31.978L254.068,31.978L254.068,28.858L224.688,28.858L224.688,94.768L228.068,94.768Z" style="fill:white;fill-rule:nonzero;"/>
|
39
39
|
</g>
|
40
40
|
<g transform="matrix(1.13316,0,0,1.87543,-27.5826,-16.1583)">
|
41
|
-
<path d="
|
41
|
+
<path d="M274.998,94.768L277.468,88.268L320.368,88.268L322.838,94.768L326.478,94.768L301.388,28.858L296.448,28.858L271.358,94.768L274.998,94.768ZM298.918,31.978L319.198,85.148L278.638,85.148L298.918,31.978Z" style="fill:white;fill-rule:nonzero;"/>
|
42
42
|
</g>
|
43
43
|
<g transform="matrix(1.13316,0,0,1.87543,-27.5826,-16.1583)">
|
44
|
-
<path d="
|
44
|
+
<path d="M389.658,94.768L389.658,91.648L360.538,91.648L360.538,28.858L357.158,28.858L357.158,94.768L389.658,94.768Z" style="fill:white;fill-rule:nonzero;"/>
|
45
45
|
</g>
|
46
46
|
<g transform="matrix(1.13316,0,0,1.87543,-27.5826,-16.1583)">
|
47
|
-
<path d="
|
47
|
+
<path d="M412.018,61.878C412.018,57.718 412.733,53.818 414.163,50.178C415.593,46.538 417.608,43.374 420.208,40.688C422.808,38.001 425.971,35.878 429.698,34.318C433.425,32.758 437.585,31.978 442.178,31.978C444.431,31.978 446.446,32.129 448.223,32.433C450,32.736 451.495,33.104 452.708,33.538C454.181,33.971 455.438,34.491 456.478,35.098L458.298,31.978C456.911,31.371 455.438,30.808 453.878,30.288C452.405,29.854 450.715,29.464 448.808,29.118C446.901,28.771 444.691,28.598 442.178,28.598C437.758,28.598 433.533,29.378 429.503,30.938C425.473,32.498 421.92,34.729 418.843,37.633C415.766,40.536 413.296,44.046 411.433,48.163C409.57,52.279 408.638,56.851 408.638,61.878C408.638,66.991 409.526,71.584 411.303,75.658C413.08,79.731 415.528,83.219 418.648,86.123C421.768,89.026 425.408,91.258 429.568,92.818C433.728,94.378 438.148,95.158 442.828,95.158C445.428,95.158 447.768,94.941 449.848,94.508C451.928,94.074 453.705,93.598 455.178,93.078C456.825,92.471 458.298,91.778 459.598,90.998L457.778,87.878C456.651,88.658 455.351,89.308 453.878,89.828C452.578,90.348 451.018,90.803 449.198,91.193C447.378,91.583 445.255,91.778 442.828,91.778C438.061,91.778 433.771,90.998 429.958,89.438C426.145,87.878 422.916,85.754 420.273,83.068C417.63,80.381 415.593,77.218 414.163,73.578C412.733,69.938 412.018,66.038 412.018,61.878Z" style="fill:white;fill-rule:nonzero;"/>
|
48
48
|
</g>
|
49
49
|
<g transform="matrix(1.13316,0,0,1.87543,-27.5826,-16.1583)">
|
50
|
-
<path d="
|
50
|
+
<path d="M479.878,61.878C479.878,66.471 480.745,70.783 482.478,74.813C484.211,78.843 486.595,82.374 489.628,85.408C492.661,88.441 496.193,90.824 500.223,92.558C504.253,94.291 508.565,95.158 513.158,95.158C517.751,95.158 522.063,94.291 526.093,92.558C530.123,90.824 533.655,88.441 536.688,85.408C539.721,82.374 542.105,78.843 543.838,74.813C545.571,70.783 546.438,66.471 546.438,61.878C546.438,57.284 545.571,52.973 543.838,48.943C542.105,44.913 539.721,41.381 536.688,38.348C533.655,35.314 530.123,32.931 526.093,31.198C522.063,29.464 517.751,28.598 513.158,28.598C508.565,28.598 504.253,29.464 500.223,31.198C496.193,32.931 492.661,35.314 489.628,38.348C486.595,41.381 484.211,44.913 482.478,48.943C480.745,52.973 479.878,57.284 479.878,61.878ZM513.158,91.778C508.998,91.778 505.12,90.998 501.523,89.438C497.926,87.878 494.763,85.733 492.033,83.003C489.303,80.273 487.158,77.109 485.598,73.513C484.038,69.916 483.258,66.038 483.258,61.878C483.258,57.718 484.038,53.839 485.598,50.243C487.158,46.646 489.303,43.483 492.033,40.753C494.763,38.023 497.926,35.878 501.523,34.318C505.12,32.758 508.998,31.978 513.158,31.978C517.318,31.978 521.196,32.758 524.793,34.318C528.39,35.878 531.553,38.023 534.283,40.753C537.013,43.483 539.158,46.646 540.718,50.243C542.278,53.839 543.058,57.718 543.058,61.878C543.058,66.038 542.278,69.916 540.718,73.513C539.158,77.109 537.013,80.273 534.283,83.003C531.553,85.733 528.39,87.878 524.793,89.438C521.196,90.998 517.318,91.778 513.158,91.778Z" style="fill:white;fill-rule:nonzero;"/>
|
51
51
|
</g>
|
52
52
|
<g transform="matrix(1.13316,0,0,1.87543,-27.5826,-16.1583)">
|
53
|
-
<path d="
|
53
|
+
<path d="M581.278,94.768L581.278,34.708L624.178,94.768L627.558,94.768L627.558,28.858L624.178,28.858L624.178,88.918L581.278,28.858L577.898,28.858L577.898,94.768L581.278,94.768Z" style="fill:white;fill-rule:nonzero;"/>
|
54
54
|
</g>
|
55
55
|
</g>
|
56
56
|
<g transform="matrix(1,0,0,1,-396.089,86.5424)">
|
57
|
-
<
|
57
|
+
<path d="M211.688,18.458L262.778,18.458L262.778,41.208L239.378,41.208L239.378,50.828L262.388,50.828L262.388,72.408L239.378,72.408L239.378,105.168L211.688,105.168L211.688,18.458ZM228.068,94.768L228.068,63.178L252.768,63.178L252.768,60.058L228.068,60.058L228.068,31.978L254.068,31.978L254.068,28.858L224.688,28.858L224.688,94.768L228.068,94.768Z" style="fill-rule:nonzero;"/>
|
58
|
+
<path d="M288.518,18.458L309.318,18.458L342.208,105.168L314.908,105.168L312.048,97.368L285.788,97.368L282.928,105.168L255.628,105.168L288.518,18.458ZM304.768,78.258L298.918,63.048L293.068,78.258L304.768,78.258ZM274.998,94.768L277.468,88.268L320.368,88.268L322.838,94.768L326.478,94.768L301.388,28.858L296.448,28.858L271.358,94.768L274.998,94.768ZM298.918,31.978L319.198,85.148L278.638,85.148L298.918,31.978Z" style="fill-rule:nonzero;"/>
|
59
|
+
<path d="M344.158,18.458L373.018,18.458L373.018,82.418L396.938,82.418L396.938,105.168L344.158,105.168L344.158,18.458ZM389.658,94.768L389.658,91.648L360.538,91.648L360.538,28.858L357.158,28.858L357.158,94.768L389.658,94.768Z" style="fill-rule:nonzero;"/>
|
60
|
+
<path d="M412.018,61.878C412.018,57.718 412.733,53.818 414.163,50.178C415.593,46.538 417.608,43.374 420.208,40.688C422.808,38.001 425.971,35.878 429.698,34.318C433.425,32.758 437.585,31.978 442.178,31.978C444.431,31.978 446.446,32.129 448.223,32.433C450,32.736 451.495,33.104 452.708,33.538C454.181,33.971 455.438,34.491 456.478,35.098L458.298,31.978C456.911,31.371 455.438,30.808 453.878,30.288C452.405,29.854 450.715,29.464 448.808,29.118C446.901,28.771 444.691,28.598 442.178,28.598C437.758,28.598 433.533,29.378 429.503,30.938C425.473,32.498 421.92,34.729 418.843,37.633C415.766,40.536 413.296,44.046 411.433,48.163C409.57,52.279 408.638,56.851 408.638,61.878C408.638,66.991 409.526,71.584 411.303,75.658C413.08,79.731 415.528,83.219 418.648,86.123C421.768,89.026 425.408,91.258 429.568,92.818C433.728,94.378 438.148,95.158 442.828,95.158C445.428,95.158 447.768,94.941 449.848,94.508C451.928,94.074 453.705,93.598 455.178,93.078C456.825,92.471 458.298,91.778 459.598,90.998L457.778,87.878C456.651,88.658 455.351,89.308 453.878,89.828C452.578,90.348 451.018,90.803 449.198,91.193C447.378,91.583 445.255,91.778 442.828,91.778C438.061,91.778 433.771,90.998 429.958,89.438C426.145,87.878 422.916,85.754 420.273,83.068C417.63,80.381 415.593,77.218 414.163,73.578C412.733,69.938 412.018,66.038 412.018,61.878ZM395.638,61.878C395.638,54.944 396.851,48.683 399.278,43.093C401.705,37.503 404.998,32.714 409.158,28.728C413.318,24.741 418.171,21.686 423.718,19.563C429.265,17.439 435.158,16.378 441.398,16.378C446.338,16.378 450.736,16.854 454.593,17.808C458.45,18.761 461.765,19.844 464.538,21.058C467.745,22.444 470.518,23.961 472.858,25.608L459.208,49.658C457.821,48.618 456.305,47.621 454.658,46.668C453.185,45.974 451.43,45.303 449.393,44.653C447.356,44.003 445.038,43.678 442.438,43.678C439.751,43.678 437.281,44.154 435.028,45.108C432.775,46.061 430.803,47.361 429.113,49.008C427.423,50.654 426.101,52.583 425.148,54.793C424.195,57.003 423.718,59.364 423.718,61.878C423.718,64.391 424.216,66.753 425.213,68.963C426.21,71.173 427.575,73.101 429.308,74.748C431.041,76.394 433.078,77.694 435.418,78.648C437.758,79.601 440.315,80.078 443.088,80.078C445.861,80.078 448.331,79.731 450.498,79.038C452.665,78.344 454.485,77.564 455.958,76.698C457.691,75.744 459.208,74.618 460.508,73.318L474.158,97.368C471.818,99.274 469.045,100.964 465.838,102.438C463.065,103.651 459.728,104.778 455.828,105.818C451.928,106.858 447.465,107.378 442.438,107.378C435.678,107.378 429.438,106.273 423.718,104.063C417.998,101.853 413.058,98.754 408.898,94.768C404.738,90.781 401.488,85.993 399.148,80.403C396.808,74.813 395.638,68.638 395.638,61.878Z" style="fill-rule:nonzero;"/>
|
61
|
+
<path d="M467.658,61.878C467.658,55.638 468.85,49.744 471.233,44.198C473.616,38.651 476.866,33.819 480.983,29.703C485.1,25.586 489.931,22.336 495.478,19.953C501.025,17.569 506.918,16.378 513.158,16.378C519.398,16.378 525.291,17.569 530.838,19.953C536.385,22.336 541.216,25.586 545.333,29.703C549.45,33.819 552.7,38.651 555.083,44.198C557.466,49.744 558.658,55.638 558.658,61.878C558.658,68.118 557.466,74.011 555.083,79.558C552.7,85.104 549.45,89.936 545.333,94.053C541.216,98.169 536.385,101.419 530.838,103.803C525.291,106.186 519.398,107.378 513.158,107.378C506.918,107.378 501.025,106.186 495.478,103.803C489.931,101.419 485.1,98.169 480.983,94.053C476.866,89.936 473.616,85.104 471.233,79.558C468.85,74.011 467.658,68.118 467.658,61.878ZM479.878,61.878C479.878,66.471 480.745,70.783 482.478,74.813C484.211,78.843 486.595,82.374 489.628,85.408C492.661,88.441 496.193,90.824 500.223,92.558C504.253,94.291 508.565,95.158 513.158,95.158C517.751,95.158 522.063,94.291 526.093,92.558C530.123,90.824 533.655,88.441 536.688,85.408C539.721,82.374 542.105,78.843 543.838,74.813C545.571,70.783 546.438,66.471 546.438,61.878C546.438,57.284 545.571,52.973 543.838,48.943C542.105,44.913 539.721,41.381 536.688,38.348C533.655,35.314 530.123,32.931 526.093,31.198C522.063,29.464 517.751,28.598 513.158,28.598C508.565,28.598 504.253,29.464 500.223,31.198C496.193,32.931 492.661,35.314 489.628,38.348C486.595,41.381 484.211,44.913 482.478,48.943C480.745,52.973 479.878,57.284 479.878,61.878ZM494.958,61.878C494.958,64.391 495.435,66.753 496.388,68.963C497.341,71.173 498.641,73.101 500.288,74.748C501.935,76.394 503.863,77.694 506.073,78.648C508.283,79.601 510.645,80.078 513.158,80.078C515.671,80.078 518.033,79.601 520.243,78.648C522.453,77.694 524.381,76.394 526.028,74.748C527.675,73.101 528.975,71.173 529.928,68.963C530.881,66.753 531.358,64.391 531.358,61.878C531.358,59.364 530.881,57.003 529.928,54.793C528.975,52.583 527.675,50.654 526.028,49.008C524.381,47.361 522.453,46.061 520.243,45.108C518.033,44.154 515.671,43.678 513.158,43.678C510.645,43.678 508.283,44.154 506.073,45.108C503.863,46.061 501.935,47.361 500.288,49.008C498.641,50.654 497.341,52.583 496.388,54.793C495.435,57.003 494.958,59.364 494.958,61.878ZM513.158,91.778C508.998,91.778 505.12,90.998 501.523,89.438C497.926,87.878 494.763,85.733 492.033,83.003C489.303,80.273 487.158,77.109 485.598,73.513C484.038,69.916 483.258,66.038 483.258,61.878C483.258,57.718 484.038,53.839 485.598,50.243C487.158,46.646 489.303,43.483 492.033,40.753C494.763,38.023 497.926,35.878 501.523,34.318C505.12,32.758 508.998,31.978 513.158,31.978C517.318,31.978 521.196,32.758 524.793,34.318C528.39,35.878 531.553,38.023 534.283,40.753C537.013,43.483 539.158,46.646 540.718,50.243C542.278,53.839 543.058,57.718 543.058,61.878C543.058,66.038 542.278,69.916 540.718,73.513C539.158,77.109 537.013,80.273 534.283,83.003C531.553,85.733 528.39,87.878 524.793,89.438C521.196,90.998 517.318,91.778 513.158,91.778Z" style="fill-rule:nonzero;"/>
|
62
|
+
<path d="M565.808,18.458L588.558,18.458L612.478,51.868L612.478,18.458L639.648,18.458L639.648,105.168L616.768,105.168L592.978,71.888L592.978,105.168L565.808,105.168L565.808,18.458ZM581.278,94.768L581.278,34.708L624.178,94.768L627.558,94.768L627.558,28.858L624.178,28.858L624.178,88.918L581.278,28.858L577.898,28.858L577.898,94.768L581.278,94.768Z" style="fill-rule:nonzero;"/>
|
58
63
|
</g>
|
59
64
|
</g>
|
60
65
|
<g id="Logo" transform="matrix(1,0,0,1,709.001,7.14337)">
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: http-protocol
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.5.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.5.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: async-io
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,14 +44,14 @@ dependencies:
|
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
47
|
+
version: 0.31.0
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
54
|
+
version: 0.31.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: async-container
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,6 +214,7 @@ files:
|
|
200
214
|
- lib/falcon/verbose.rb
|
201
215
|
- lib/falcon/version.rb
|
202
216
|
- lib/rack/handler/falcon.rb
|
217
|
+
- logo.afdesign
|
203
218
|
- logo.svg
|
204
219
|
- server.rb
|
205
220
|
homepage: https://github.com/socketry/falcon
|
@@ -221,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
236
|
version: '0'
|
222
237
|
requirements: []
|
223
238
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.7.
|
239
|
+
rubygems_version: 2.7.7
|
225
240
|
signing_key:
|
226
241
|
specification_version: 4
|
227
242
|
summary: A fast, asynchronous, rack-compatible web server.
|