Page MenuHomeFreeBSD

www/h2o: update to 2.2.4
ClosedPublic

Authored by dch on Nov 14 2017, 12:23 AM.

Details

Summary
  • includes websocket fix and bonus improved docs

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dch created this revision.Nov 14 2017, 12:23 AM
jrm added a comment.Nov 14 2017, 2:28 AM

I don't see how/where this patch is being applied?

dch updated this revision to Diff 35355.Nov 16 2017, 10:31 PM
dch retitled this revision from www/h2o: fix incorrect headers during websocket upgrade pull in patch from master branch in github to www/h2o: fix incorrect headers during websocket upgrade.
dch edited the summary of this revision. (Show Details)

Supply svn ports diff this time and not the upstream git patch

The actual bug is that the header ends up with an incorrect field:

"upgrade: websockets, websockets" which breaks some but not all
ws clients.

FWIW here's how I tested it:

  • get websocketd.com (my next port)
websocketd --devconsole --port 1080 sh -c "while true; do fortune; sleep 1; done"

run h2o to proxy this connection back to a browser

yaml
# /usr/local/etc/h2o/h2o.conf
#ee https://h2o.examp1e.net/ for detailed documentation
user: www
pid-file: /var/run/h2o.pid
access-log: /var/log/h2o/h2o-access.log
error-log: /var/log/h2o/h2o-error.log
listen: 80
hosts:
  localhost:
    paths:
      "/ok.json":
        mruby.handler: |
          Proc.new do |env|
            [200, {'content-type' => 'application/json'}, ['{"status":"ok"}']]
          end
      "/":
        proxy.websocket: ON
        proxy.reverse.url: "http://localhost:1080/"
jrm accepted this revision.Nov 17 2017, 2:15 AM

Lgtm. Merge quarterly? Did you want to update your maintainer address to dch@FreeBSD.org?

This revision is now accepted and ready to land.Nov 17 2017, 2:15 AM
dch updated this revision to Diff 36041.Dec 1 2017, 11:20 AM

update my maintainer @ and refine licence for mruby components

This revision now requires review to proceed.Dec 1 2017, 11:20 AM
dch updated this revision to Diff 36042.Dec 1 2017, 11:44 AM

provide more examples and a decent secure-by-default config

jrm added inline comments.Dec 1 2017, 12:07 PM
www/h2o/files/h2o.conf.sample
16 ↗(On Diff #36042)

h2o.conf.sample.in and %%ETCDIR%% ?

63 ↗(On Diff #36042)

%%PREFIX%%

dch updated this revision to Diff 36043.Dec 1 2017, 12:14 PM

update sample to get best possible security scores on ssllabs.com and securityheaders.io

jrm added inline comments.Dec 4 2017, 1:44 PM
www/h2o/files/h2o.conf.sample
18 ↗(On Diff #36043)

h2o.conf.sample.in and %%ETCDIR%% ?

67 ↗(On Diff #36043)

Sorry, meant to write %%ETCDIR%% here as well.

73 ↗(On Diff #36043)

/usr/local -> %%PREFIX%% ?

dch updated this revision to Diff 36630.Dec 15 2017, 4:45 PM

we released 2.2.4 so the websocket fix is now shipped. this update contains
the improved sample config file as a bonus.

dch retitled this revision from www/h2o: fix incorrect headers during websocket upgrade to www/h2o: update to 2.2.4.Dec 15 2017, 4:46 PM
dch edited the summary of this revision. (Show Details)
jrm added a comment.Dec 15 2017, 9:23 PM

Not specific to this review, but I think it is safe to replace share/h2o with %%DATADIR%% in pkg-plist. You test by redefining DATADIR. Your call.
Also, cmake reports

-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
...
-- Found LIBUV: /usr/local/lib/libuv.so                                                                                                                                                       
-- libuv found but ignored; is too old                                                                                                                                                        
-- Could NOT find WSLAY (missing: WSLAY_LIBRARIES WSLAY_INCLUDE_DIR)

Cause for concern?

dch accepted this revision.EditedDec 16 2017, 12:06 AM
In D13077#282341, @jrm wrote:

wrt pkgconfig, h2o falls back to a more primitive detection without it
but it works with pkgconfig now so lets use that.

Not specific to this review, but I think it is safe to replace share/h2o with %%DATADIR%% in pkg-plist. You test by redefining DATADIR. Your call.

works fine - thanks

Also, cmake reports

-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
...
-- Found LIBUV: /usr/local/lib/libuv.so                                                                                                                                                       
-- libuv found but ignored; is too old                                                                                                                                                        
-- Could NOT find WSLAY (missing: WSLAY_LIBRARIES WSLAY_INCLUDE_DIR)

Cause for concern?

No, but its a bit odd.

libuv isn't used since a while, see http://blog.kazuhooku.com/2014/09/the-reasons-why-i-stopped-using-libuv.html
wslay is allegedly needed for websocket proxy but is demonstrably not needed in practice.

I've asked upstream what is up with these, and we'll resolve them in the next release.

This revision is now accepted and ready to land.Dec 16 2017, 12:06 AM
jrm accepted this revision.Dec 16 2017, 12:07 AM
This revision was automatically updated to reflect the committed changes.