Re: relayd(8) websockets proxy broken after adding websockets support

2019-04-12 Thread Rivo Nurges
Hi!

I previously proposed following.

https://marc.info/?l=openbsd-tech&m=155190594005692&w=2

Rivo

On 4/10/19 2:38 PM, Pavel Korovin wrote:
> Dear all,
> 
> After websockets support was added in relayd(8),
> https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/relayd/relay_http.c.diff?r1=1.71&r2=1.72&f=h
> the connections to services usging websockets are broken.
> 
> I checked what caused this breakage, and found that the check for the
> "Connection" HTTP request header strictly checks for "Upgrade" value (line 
> 402):
> 
> if (cre->dir == RELAY_DIR_REQUEST) {
>   if (strcasecmp("Connection", key) == 0 &&
>   strcasecmp("Upgrade", value) == 0)
>   priv->http_upgrade_req |=
>   HTTP_CONNECTION_UPGRADE;
> 
> while the browser can also send (and sends)
>   Connection: keep-alive, Upgrade
> 
> Websockets work fine if I add keep-alive to the list of values, but I'm sure
> this must be fixed in some other way,
> 
> --- usr.sbin/relayd/relay_http.c.orig   Wed Apr  3 17:41:00 2019
> +++ usr.sbin/relayd/relay_http.cWed Apr  3 21:31:37 2019
> @@ -400,7 +400,8 @@
>  if (cre->line != 1) {
>  if (cre->dir == RELAY_DIR_REQUEST) {
>  if (strcasecmp("Connection", key) == 0 &&
> -   strcasecmp("Upgrade", value) == 0)
> +  (strcasecmp("Upgrade", value) == 0 ||
> +  strcasecmp("keep-alive, Upgrade", value) 
> == 0))
>  priv->http_upgrade_req |=
>  HTTP_CONNECTION_UPGRADE;
>  if (strcasecmp("Upgrade", key) == 0 &&
> 



[PATCH] [www] 65.html - use class="cmdbox" for command examples

2019-04-12 Thread Raf Czlonka
Hi all,

class="cmdbox" has been introduced last year so, since it is has
already been used in upgrade64.html[0], how about using it for
release pages, too?

I wasn't sure about signify(1) subkeys  tag but added it there
anyway...

[0] https://www.openbsd.org/faq/upgrade64.html

Regards,

Raf
Index: 65.html
===
RCS file: /cvs/www/65.html,v
retrieving revision 1.79
diff -u -p -r1.79 65.html
--- 65.html 13 Apr 2019 03:40:42 -  1.79
+++ 65.html 13 Apr 2019 06:18:11 -
@@ -38,7 +38,7 @@ Artwork by Hans Tseng, Efrain Farias, an
 
 https://man.openbsd.org/signify.1";>signify(1)
 pubkeys for this release:
-
+
 base: RWSZaRmt1LEQT9CtPygf9CvONu8kYPTlVEJdysNoUR62/NkeWgdkc3zY
 fw:   RWQYdGVtTv5IvpH2c+TLQAC4iV7RjoGZ/v75q8MCuC9Mca7nFVCXRefy
 pkg:  RWS5D4+188RI6jULDOFzga0Cm1zrXYUAHT6xu0mLrZidbn6xrMB5aZeR
@@ -907,21 +907,21 @@ This file contains everything you need e
 which are in a separate archive.
 To extract:
 
-
+
 # mkdir -p /usr/src
 # cd /usr/src
 # tar xvfz /tmp/src.tar.gz
-
+
 
 sys.tar.gz contains a source archive starting at 
/usr/src/sys.
 This file contains all the kernel sources you need to rebuild kernels.
 To extract:
 
-
+
 # mkdir -p /usr/src/sys
 # cd /usr/src
 # tar xvfz /tmp/sys.tar.gz
-
+
 
 Both of these trees are a regular CVS checkout.  Using these trees it
 is possible to get a head-start on using the anoncvs servers as
@@ -937,10 +937,10 @@ a fresh checkout of the full OpenBSD sou
 
 A ports tree archive is also provided.  To extract:
 
-
+
 # cd /usr
 # tar xvfz /tmp/ports.tar.gz
-
+
 
 Go read the ports page
 if you know nothing about ports
@@ -955,10 +955,10 @@ So, in order to keep up to date with the
 the ports/ tree available on a read-write medium and update the tree
 with a command like:
 
-
+
 # cd /usr/ports
 # cvs -d anon...@server.openbsd.org:/cvs update -Pd -rOPENBSD_6_5
-
+
 
 [Of course, you must replace the server name here with a nearby anoncvs
 server.]