/ Zope / Apsis / Pound Mailing List / Archive / 2018 / 2018-08 / [Patch] WebSocket support for pound

[ << ] [ >> ]

[ Newbee questions / Byron Paul ... ] [ How to redirect all websites from http to https ... ]

[Patch] WebSocket support for pound
"Frank Schmirler" <frank.schmirler(at)linogate.com>
2018-08-07 11:58:42 [ FULL ]
Hi,

we recently stumbled over the missing WebSocket support in pound. I attached a
patch against vanilla pound-2.8 which adds support. So far it has been tested
with Guacamole (https://guacamole.apache.org/) and
with a commercial product
using WebSockts and it worked without any problems or side effects.

The patch collects the various markers for an upgrade request and for the
server`s acceptance of the upgrade in variable "is_ws". When all markers have
been collected, the connection switches to "WebSocket mode", i.e. simply
forward everything between client and server in both directions until the
connection is closed or times out. There is no parsing of WebSocket frames.

With the patch, WebSockets should start working out of the box. There's no
need to configure anything special (except for the usual listener, service and
backend configuration of course). WebSocket connections are usually long-lived
(hours or even days). However WebSocket clients usually send keep alive
packets to prevent timeouts or silently re-connect when the connection is
closed. So I decided to use a rather conservative timeout of just 600 seconds.
You can override this default with the new configuration file directive
"WSTimeout <seconds>" on the global level and per backend.

Regards,
Frank
Attachments:  
pound-2.8-websocket.diff text/x-patch 15001 Bytes

Re: [Pound Mailing List] [Patch] WebSocket support for pound
Alexander Kolodziej <alexander.kolodziej(at)tactel.se>
2018-08-10 15:54:47 [ FULL ]
This is awesome!

I will try this out sometime soon! Thanks!
[...]

Re: [Pound Mailing List] [Patch] WebSocket support for pound
Carlos Baptista <carlos.baptista(at)infarmed.pt>
2018-08-17 17:23:37 [ FULL ]
Hi,

Thanks for this. I will try it after vacation and give feddback.

Thanks

Carlos Baptista

On Tue, 2018-08-07 at 11:58 +0200, Frank Schmirler wrote:

Hi,


we recently stumbled over the missing WebSocket support in pound. I attached a

patch against vanilla pound-2.8 which adds support. So far it has been tested

with Guacamole (https://guacamole.apache.org/) and
with a commercial product

using WebSockts and it worked without any problems or side effects.


The patch collects the various markers for an upgrade request and for the

server`s acceptance of the upgrade in variable "is_ws". When all markers have

been collected, the connection switches to "WebSocket mode", i.e. simply

forward everything between client and server in both directions until the

connection is closed or times out. There is no parsing of WebSocket frames.


With the patch, WebSockets should start working out of the box. There's no

need to configure anything special (except for the usual listener, service and

backend configuration of course). WebSocket connections are usually long-lived

(hours or even days). However WebSocket clients usually send keep alive

packets to prevent timeouts or silently re-connect when the connection is

closed. So I decided to use a rather conservative timeout of just 600 seconds.

You can override this default with the new configuration file directive

"WSTimeout <seconds>" on the global level and per backend.


Regards,

Frank
Attachments:  
text.html text/html 2330 Bytes

MailBoxer